Index: ui/gl/gl_context_cgl.cc |
=================================================================== |
--- ui/gl/gl_context_cgl.cc (revision 158210) |
+++ ui/gl/gl_context_cgl.cc (working copy) |
@@ -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 @@ |
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 @@ |
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); |
} |