Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: ui/gfx/gl/gl_implementation.cc

Issue 7967020: Implement --use-gl=any (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698