Chromium Code Reviews| Index: ui/gl/init/gl_factory.cc |
| diff --git a/ui/gl/init/gl_factory.cc b/ui/gl/init/gl_factory.cc |
| index 376ab44952cc30137ecf5865aef88e6921eef7f3..e914a744fac3910171f0e9402d3fc2eb1326ba38 100644 |
| --- a/ui/gl/init/gl_factory.cc |
| +++ b/ui/gl/init/gl_factory.cc |
| @@ -29,14 +29,14 @@ bool InitializeGLOneOff() { |
| // The default implementation is always the first one in list. |
| GLImplementation impl = allowed_impls[0]; |
| - bool fallback_to_osmesa = false; |
| - if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) { |
| - impl = kGLImplementationOSMesaGL; |
| + bool fallback_to_software_rendering = false; |
|
Ken Russell (switch to Gerrit)
2017/02/15 02:32:15
Could you call this fallback_to_software_gl?
|
| + if (cmd->HasSwitch(switches::kOverrideUseSoftwareGLForTests)) { |
| + impl = GetSoftwareGLImplementation(); |
| } else if (cmd->HasSwitch(switches::kUseGL)) { |
| std::string requested_implementation_name = |
| cmd->GetSwitchValueASCII(switches::kUseGL); |
| if (requested_implementation_name == "any") { |
| - fallback_to_osmesa = true; |
| + fallback_to_software_rendering = true; |
| } else if (requested_implementation_name == |
| kGLImplementationSwiftShaderName) { |
| impl = kGLImplementationSwiftShaderGL; |
| @@ -56,19 +56,20 @@ bool InitializeGLOneOff() { |
| bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging); |
| bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests); |
| - return InitializeGLOneOffImplementation( |
| - impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing); |
| + return InitializeGLOneOffImplementation(impl, fallback_to_software_rendering, |
| + gpu_service_logging, |
| + disable_gl_drawing); |
| } |
| bool InitializeGLOneOffImplementation(GLImplementation impl, |
| - bool fallback_to_osmesa, |
| + bool fallback_to_software_rendering, |
| bool gpu_service_logging, |
| bool disable_gl_drawing) { |
| bool initialized = |
| InitializeStaticGLBindings(impl) && InitializeGLOneOffPlatform(); |
| - if (!initialized && fallback_to_osmesa) { |
| + if (!initialized && fallback_to_software_rendering) { |
| ShutdownGL(); |
| - initialized = InitializeStaticGLBindings(kGLImplementationOSMesaGL) && |
| + initialized = InitializeStaticGLBindings(GetSoftwareGLImplementation()) && |
| InitializeGLOneOffPlatform(); |
| } |
| if (!initialized) |