summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_context_cgl.cc
diff options
context:
space:
mode:
authortzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-23 19:25:28 +0000
committertzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-23 19:25:28 +0000
commit008e9a2c212429a089af2bd9b1ff6e6529470086 (patch)
tree2f13f12ac5be2aeb3c61056a45cdce38124af20d /ui/gl/gl_context_cgl.cc
parentae587d81e5c3ff6c394b4e675408fa0ed67622b9 (diff)
downloadchromium_src-008e9a2c212429a089af2bd9b1ff6e6529470086.zip
chromium_src-008e9a2c212429a089af2bd9b1ff6e6529470086.tar.gz
chromium_src-008e9a2c212429a089af2bd9b1ff6e6529470086.tar.bz2
Revert 158076 - 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 TBR=zmo@chromium.org Review URL: https://codereview.chromium.org/10959061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_context_cgl.cc')
-rw-r--r--ui/gl/gl_context_cgl.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index a2cf560..9fdfa69 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -13,7 +13,6 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_cgl.h"
-#include "ui/gl/gpu_switching_manager.h"
namespace gfx {
@@ -28,9 +27,6 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface,
GpuPreference gpu_preference) {
DCHECK(compatible_surface);
- gpu_preference = GpuSwitchingManager::GetInstance()->AdjustGpuPreference(
- gpu_preference);
-
GLContextCGL* share_context = share_group() ?
static_cast<GLContextCGL*>(share_group()->GetContext()) : NULL;
@@ -220,6 +216,17 @@ GpuPreference GLContextCGL::GetGpuPreference() {
return gpu_preference_;
}
+void GLContextCGL::ForceUseOfDiscreteGPU() {
+ static CGLPixelFormatObj format = NULL;
+ if (format)
+ return;
+ CGLPixelFormatAttribute attribs[1];
+ attribs[0] = static_cast<CGLPixelFormatAttribute>(0);
+ GLint num_pixel_formats = 0;
+ CGLChoosePixelFormat(attribs, &format, &num_pixel_formats);
+ // format is deliberately leaked.
+}
+
void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const {
CGLDestroyRendererInfo(x);
}