diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 21:26:56 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 21:26:56 +0000 |
commit | a605729023f03852a0cbeefbab5d59cc29b84aeb (patch) | |
tree | c95e133af58cb458d5476bab3b61a90831a5869c /content/gpu/gpu_info_collector_linux.cc | |
parent | 6f9382246177f915fe14d5700d7c1f733b9bd80b (diff) | |
download | chromium_src-a605729023f03852a0cbeefbab5d59cc29b84aeb.zip chromium_src-a605729023f03852a0cbeefbab5d59cc29b84aeb.tar.gz chromium_src-a605729023f03852a0cbeefbab5d59cc29b84aeb.tar.bz2 |
Add --gpu-no-context-lost commandline switch.
At the moment chrome users with GLES backend do not have accelerated 2d canvas if a graphics context could be lost. Unfortunately we don't have a way to know if a GLES backend does or does not lose context in situations like entering power saving mode, screen saving mode, etc. This switch basically tells chrome the backend does not lose context, thus, enable accelerated 2d canvas.
BUG=90464
TEST=bots green, passing this switch with GLES backend enables accelerated 2d canvas
Review URL: http://codereview.chromium.org/7530008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu/gpu_info_collector_linux.cc')
-rw-r--r-- | content/gpu/gpu_info_collector_linux.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/content/gpu/gpu_info_collector_linux.cc b/content/gpu/gpu_info_collector_linux.cc index c8115bf3..79b1cce 100644 --- a/content/gpu/gpu_info_collector_linux.cc +++ b/content/gpu/gpu_info_collector_linux.cc @@ -7,6 +7,7 @@ #include <dlfcn.h> #include <vector> +#include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -17,6 +18,7 @@ #include "ui/gfx/gl/gl_bindings.h" #include "ui/gfx/gl/gl_context.h" #include "ui/gfx/gl/gl_implementation.h" +#include "ui/gfx/gl/gl_switches.h" namespace { @@ -192,10 +194,16 @@ namespace gpu_info_collector { bool CollectGraphicsInfo(GPUInfo* gpu_info) { DCHECK(gpu_info); - // TODO(zmo): need to consider the case where we are running on top of - // desktop GL and GL_ARB_robustness extension is available. - gpu_info->can_lose_context = - (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kGpuNoContextLost)) { + gpu_info->can_lose_context = false; + } else { + // TODO(zmo): need to consider the case where we are running on top + // of desktop GL and GL_ARB_robustness extension is available. + gpu_info->can_lose_context = + (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); + } + gpu_info->finalized = true; return CollectGraphicsInfoGL(gpu_info); } |