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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 13746002: Force GPU switch with CGLSetVirtualScreen only for compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« gpu/command_buffer/service/gles2_cmd_decoder.cc ('K') | « ui/gl/gl_context_cgl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 7d5a92317cd91d87baaa6bcd59a57709f3c0d666..f88f9c940951b9ed3c8f9147e9d79e0d15c4c313 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -19,6 +19,8 @@ namespace gfx {
bool g_support_renderer_switching;
+bool g_force_cgl_set_virtual_screen = false;
+
static CGLPixelFormatObj GetPixelFormat() {
static CGLPixelFormatObj format;
if (format)
@@ -149,7 +151,10 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) {
screen_renderer_id &= kCGLRendererIDMatchingMask;
if (screen_renderer_id == renderer_id) {
- CGLSetVirtualScreen(static_cast<CGLContextObj>(context_), i);
+ // This call can hang on some AMD drivers
+ // http://crbug.com/227228
+ if (g_force_cgl_set_virtual_screen)
jbauman 2013/04/06 01:52:02 I'd recommend moving this check up to the beginnin
ccameron 2013/04/08 17:25:14 I put the whole thing in an if-block. My initial i
+ CGLSetVirtualScreen(static_cast<CGLContextObj>(context_), i);
screen_ = i;
break;
}
@@ -267,6 +272,11 @@ bool GLContextCGL::GetTotalGpuMemory(size_t* bytes) {
return false;
}
+// static
+void GLContextCGL::ForceCGLSetVirtualScreen() {
+ g_force_cgl_set_virtual_screen = true;
+}
+
GLContextCGL::~GLContextCGL() {
Destroy();
}
« gpu/command_buffer/service/gles2_cmd_decoder.cc ('K') | « ui/gl/gl_context_cgl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698