diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-22 00:16:48 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-22 00:16:48 +0000 |
commit | 57e8dd648aac82f073476739953d823d41c75953 (patch) | |
tree | 302743adb80007303b28fad88b106dc6f04a2db0 /ui/gl/gpu_switching_manager.h | |
parent | 541c28da0d4682fe4279f5a2c21c327b3e2707b6 (diff) | |
download | chromium_src-57e8dd648aac82f073476739953d823d41c75953.zip chromium_src-57e8dd648aac82f073476739953d823d41c75953.tar.gz chromium_src-57e8dd648aac82f073476739953d823d41c75953.tar.bz2 |
Honor --gpu-switching=force_discrete to always stay on discrete GPU.
Before we only stays on discrete GPU if any GL contexts are active.
Now we truly stay on discrete GPU, always.
This CL also remove --disable-gpu-switching;
use --gpu-switching=force_integrated/force_discrete instead.
Also, user's --gpu-switching option will overwrite the hardwired
force_discrete decision, i.e., if a user wants to stay on integrated
GPU and save battery, we honor that.
BUG=140114,131276,111720
TEST=tree
Review URL: https://codereview.chromium.org/10959050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gpu_switching_manager.h')
-rw-r--r-- | ui/gl/gpu_switching_manager.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/gl/gpu_switching_manager.h b/ui/gl/gpu_switching_manager.h index a5b37df..0534c98 100644 --- a/ui/gl/gpu_switching_manager.h +++ b/ui/gl/gpu_switching_manager.h @@ -8,6 +8,9 @@ #include <vector> #include "base/memory/singleton.h" +#if defined(OS_MACOSX) +#include "ui/gl/gl_context_cgl.h" +#endif // OS_MACOSX #include "ui/gl/gl_export.h" #include "ui/gl/gpu_preference.h" @@ -23,8 +26,10 @@ class GL_EXPORT GpuSwitchingManager { void ForceUseOfIntegratedGpu(); void ForceUseOfDiscreteGpu(); - // Adjust GpuPreference based on the current switching option. - // If none is set, return the original GpuPreference. + // If no GPU is forced, return the original GpuPreference; otherwise, return + // the forced GPU. + // If forcing discrete GPU on Mac, we set up a pixel format, which keeps + // Chrome on the discrete GPU throughout the rest of Chrome's lifetime. GpuPreference AdjustGpuPreference(GpuPreference gpu_preference); private: |