diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 18:12:55 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 18:12:55 +0000 |
commit | 14030054ebf9fb1b066edab8b4b10bc595aa261f (patch) | |
tree | d657b0df52f6ee6d302b40b5c5b53b05d20fc6a9 /ui | |
parent | fcd709a4e35504faf7e95096f53baa895ce5b3ee (diff) | |
download | chromium_src-14030054ebf9fb1b066edab8b4b10bc595aa261f.zip chromium_src-14030054ebf9fb1b066edab8b4b10bc595aa261f.tar.gz chromium_src-14030054ebf9fb1b066edab8b4b10bc595aa261f.tar.bz2 |
Implement --use-gl=any
The behavior is this: if --use-gl=any passes in, and the default GL binding causes GPU features to be blacklisted, fallback to osmesa. Also, in GPU process, if the default binding fails, fallback to osmesa.
This option will be used in testing to make sure accelerated path is always tested, if not on GPU, then on top of osmesa.
This CL also moves certain functions out of GpuBlacklist to GpuDataManager so we could manage the special cases when --use-gl=osmesa or --use-gl=any is passed.
BUG=97675
TEST=bots green
Review URL: http://codereview.chromium.org/7967020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/gl_implementation.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/gfx/gl/gl_implementation.cc b/ui/gfx/gl/gl_implementation.cc index ae4b2d6..19cc91c 100644 --- a/ui/gfx/gl/gl_implementation.cc +++ b/ui/gfx/gl/gl_implementation.cc @@ -65,11 +65,18 @@ bool InitializeRequestedGLBindings( 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 @@ bool InitializeRequestedGLBindings( InitializeGLBindings(default_implementation); } + if (GetGLImplementation() == kGLImplementationNone && fallback_to_osmesa) + InitializeGLBindings(kGLImplementationOSMesaGL); + if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableGPUServiceLogging)) { InitializeDebugGLBindings(); |