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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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_egl_api_implementation.h ('k') | ui/gl/gl_glx_api_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f4dca224e2f884b91ddaed513c6f02542e951839..017e123eb1ff5f566031b9018a6cc2dff715090d 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -442,9 +442,14 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
DCHECK(virtual_context->IsCurrent(surface));
if (switched_contexts || virtual_context != current_context_) {
- // There should be no errors from the previous context leaking into the
- // new context.
- DCHECK_EQ(glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR));
+#if DCHECK_IS_ON
+ GLenum error = glGetErrorFn();
+ // Accepting a context loss error here enables using debug mode to work on
+ // context loss handling in virtual context mode.
+ // There should be no other errors from the previous context leaking into
+ // the new context.
+ DCHECK(error == GL_NO_ERROR || error == GL_CONTEXT_LOST_KHR);
+#endif
// Set all state that is different from the real state
GLApi* temp = GetCurrentGLApi();
« no previous file with comments | « ui/gl/gl_egl_api_implementation.h ('k') | ui/gl/gl_glx_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698