summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 21:09:28 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 21:09:28 +0000
commit4d6593245d07ac90faf0027f7bf45725e7cc3aff (patch)
treed0178cd81844ba12355bc56dc9e10e8f2ccacf71 /content/gpu
parent19cfda967ded48c88c7f8527fd8fcc6c6fbb9760 (diff)
downloadchromium_src-4d6593245d07ac90faf0027f7bf45725e7cc3aff.zip
chromium_src-4d6593245d07ac90faf0027f7bf45725e7cc3aff.tar.gz
chromium_src-4d6593245d07ac90faf0027f7bf45725e7cc3aff.tar.bz2
Implement blacklist's force GPU capability in dual GPU machines.
This is part 2. In part one we implement the semantics in blacklist. Now we hook it up with the "real" forcing code. For now we only hook it up with Mac CGL port. BUG=140114,131276,111720 TEST=tree Review URL: https://codereview.chromium.org/10909221 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_main.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 5e71bc2..be8b154 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -22,10 +22,12 @@
#include "content/gpu/gpu_process.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/gpu_switching_option.h"
#include "content/public/common/main_function_params.h"
#include "crypto/hmac.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_switches.h"
+#include "ui/gl/gpu_switching_manager.h"
#if defined(OS_WIN)
#include "content/common/gpu/media/dxva_video_decode_accelerator.h"
@@ -73,6 +75,15 @@ int GpuMain(const content::MainFunctionParams& parameters) {
#endif
}
+ if (command_line.HasSwitch(switches::kGpuSwitching)) {
+ std::string option = command_line.GetSwitchValueASCII(
+ switches::kGpuSwitching);
+ if (option == switches::kGpuSwitchingOptionNameForceDiscrete)
+ gfx::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu();
+ else if (option == switches::kGpuSwitchingOptionNameForceIntegrated)
+ gfx::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
+ }
+
// Initialization of the OpenGL bindings may fail, in which case we
// will need to tear down this process. However, we can not do so
// safely until the IPC channel is set up, because the detection of