~bwy/+junk/gnash-temp

« back to all changes in this revision

Viewing changes to gui/gtk_canvas.cpp

  • Committer: Rob Savoye
  • Author(s): Gwenole Beauchesne
  • Date: 2010-03-03 00:06:02 UTC
  • mto: (11788.1.53 hwaccel)
  • mto: This revision was merged to the branch mainline in revision 12042.
  • Revision ID: rob@welcomehome.org-20100303000602-70jm6rg9voaylsft
use next_hwaccel for the state change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
    if (renderer.empty()) {
222
222
        renderer = "agg";
223
223
    }
 
224
    std::string next_renderer = renderer;
224
225
 
225
226
    // If the Hardware acceleration isn't defined in gnashrc, or on
226
227
    // the command line, pick a sensible default.
227
228
    if (hwaccel.empty()) {
228
229
        hwaccel = "none";
229
230
    }
230
 
    
 
231
    std::string next_hwaccel = hwaccel;
 
232
 
231
233
    while (!initialized_renderer) {
 
234
        renderer = next_renderer;
 
235
        hwaccel = next_hwaccel;
232
236
        // Global enable VA-API, if requested
233
237
        gnash::vaapi_set_is_enabled(hwaccel == "vaapi");
234
238
        // Use the Cairo renderer. Cairo is also used by GTK2, so using
238
242
            canvas->glue.reset(new gnash::GtkCairoGlue);
239
243
            // Set the renderer to the next one to try if initializing
240
244
            // fails.
241
 
            renderer = "agg";
 
245
            next_renderer = "agg";
242
246
        }
243
247
        else if (renderer == "opengl") {
244
248
            canvas->glue.reset(new gnash::GtkGlExtGlue);
245
249
            // Set the renderer to the next one to try if initializing
246
250
            // fails.
247
 
            renderer = "agg";
 
251
            next_renderer = "agg";
248
252
            // Use the AGG software library for rendering. While this runs
249
253
            // on any hardware platform, it does have performance issues
250
254
            // on low-end platforms without a GPU. So while AGG may render
259
263
                canvas->glue.reset(new gnash::GtkAggVaapiGlue);
260
264
                // Set the hardware acclerator to the next one to try
261
265
                // if initializing fails.
262
 
                hwaccel = "xv";
 
266
                next_hwaccel = "xv";
263
267
            }
264
268
            else if (hwaccel == "xv") {
265
269
                // Use the X11 XV extension, which works on most GPUs.
266
270
                canvas->glue.reset(new gnash::GtkAggXvGlue);
267
271
                // Set the hardware acclerator to the next one to try
268
272
                // if initializing fails.
269
 
                hwaccel = "none";
 
273
                next_hwaccel = "none";
270
274
            }
271
275
            else {
272
276
                canvas->glue.reset(new gnash::GtkAggGlue);