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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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') | url/BUILD.gn » ('j') | 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 10f854aaccda3836fed6a53d2fc7bcda4d8be666..277780a3b244713610f0c6552550ef886a3faaa6 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -136,7 +136,7 @@ void GLContextCGL::Destroy() {
}
}
-bool GLContextCGL::MakeCurrent(GLSurface* surface) {
+bool GLContextCGL::ForceGpuSwitchIfNeeded() {
DCHECK(context_);
// The call to CGLSetVirtualScreen can hang on some AMD drivers
@@ -174,6 +174,14 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) {
renderer_id_ = renderer_id;
}
}
+ return true;
+}
+
+bool GLContextCGL::MakeCurrent(GLSurface* surface) {
+ DCHECK(context_);
+
+ if (!ForceGpuSwitchIfNeeded())
+ return false;
if (IsCurrent(surface))
return true;
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | url/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698