Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 10959050: Honor --gpu-switching=force_discrete to always stay on discrete GPU. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_context_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
===================================================================
--- ui/gl/gl_context_cgl.cc (revision 158081)
+++ ui/gl/gl_context_cgl.cc (working copy)
@@ -224,4 +224,15 @@
CGLDestroyRendererInfo(x);
}
+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.
+}
+
} // namespace gfx
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_context_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698