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

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
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_implementation.cc
===================================================================
--- ui/gfx/gl/gl_implementation.cc (revision 102410)
+++ ui/gfx/gl/gl_implementation.cc (working copy)
@@ -65,11 +65,18 @@
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 =
+ GLImplementation requested_implementation;
+ if (requested_implementation_name == "any") {
+ requested_implementation = default_implementation;
+ fallback_to_osmesa = true;
+ } else {
+ requested_implementation =
GetNamedGLImplementation(requested_implementation_name);
+ }
if (std::find(allowed_implementations_begin,
allowed_implementations_end,
requested_implementation) == allowed_implementations_end) {
@@ -82,6 +89,9 @@
InitializeGLBindings(default_implementation);
}
+ if (GetGLImplementation() == kGLImplementationNone && fallback_to_osmesa)
+ InitializeGLBindings(kGLImplementationOSMesaGL);
+
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUServiceLogging)) {
InitializeDebugGLBindings();
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698