Chromium Code Reviews| Index: ui/gfx/gl/gl_implementation.cc |
| =================================================================== |
| --- ui/gfx/gl/gl_implementation.cc (revision 102160) |
| +++ ui/gfx/gl/gl_implementation.cc (working copy) |
| @@ -22,7 +22,8 @@ |
| { kGLImplementationDesktopName, kGLImplementationDesktopGL }, |
| { kGLImplementationOSMesaName, kGLImplementationOSMesaGL }, |
| { kGLImplementationEGLName, kGLImplementationEGLGLES2 }, |
| - { kGLImplementationMockName, kGLImplementationMockGL } |
| + { kGLImplementationMockName, kGLImplementationMockGL }, |
| + { kGLImplementationAnyName, kGLImplementationAny } |
| }; |
| typedef std::vector<base::NativeLibrary> LibraryArray; |
| @@ -65,11 +66,16 @@ |
| const GLImplementation* allowed_implementations_begin, |
| const GLImplementation* allowed_implementations_end, |
| GLImplementation default_implementation) { |
| + bool fallback_to_osmesa = false; |
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { |
| std::string requested_implementation_name = |
| CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); |
| GLImplementation requested_implementation = |
| GetNamedGLImplementation(requested_implementation_name); |
| + if (requested_implementation == kGLImplementationAny) { |
|
alokp
2011/09/27 15:55:48
I do not think "use-gl=any" means fallback to osme
Zhenyao Mo
2011/09/27 17:17:31
Go through the list means on Windows we will try D
alokp
2011/09/27 17:22:25
If DesktopGL is not supported on windows, it shoul
Zhenyao Mo
2011/09/27 17:36:22
Currently we have only one list: allowed bindings.
|
| + requested_implementation = default_implementation; |
| + fallback_to_osmesa = true; |
| + } |
| if (std::find(allowed_implementations_begin, |
| allowed_implementations_end, |
| requested_implementation) == allowed_implementations_end) { |
| @@ -82,6 +88,9 @@ |
| InitializeGLBindings(default_implementation); |
| } |
| + if (GetGLImplementation() == kGLImplementationNone && fallback_to_osmesa) |
| + InitializeGLBindings(kGLImplementationOSMesaGL); |
| + |
| if (CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kEnableGPUServiceLogging)) { |
| InitializeDebugGLBindings(); |