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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 15841002: gpu: Fix corrupted state due to virtual MakeCurrent race. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 1002dbd278842f0e51a8868f58b1bea16bf5f5fe..6aa521689bacb148fd7f05b4c5f0b9f37d206641 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -251,6 +251,12 @@ void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) {
}
bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
+ DCHECK_EQ(!virtual_context, !surface);
+ if (!virtual_context && !surface) {
+ current_context_ = NULL;
+ return true;
+ }
+
bool switched_contexts = g_current_gl_context != this;
GLSurface* current_surface = GLSurface::GetCurrent();
if (switched_contexts || surface != current_surface) {

Powered by Google App Engine
This is Rietveld 408576698