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..56d3ff21cdd48495dcc13f30ddb66f0b80dc54ac 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 !defined(NDEBUG) |
Ken Russell (switch to Gerrit)
2014/10/29 22:21:21
Please use #if DCHECK_IS_ON instead. Our Release m
oetuaho-nv
2014/10/30 09:17:14
Got it, will do.
|
+ GLenum err = 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(err == GL_NO_ERROR || err == GL_CONTEXT_LOST_KHR); |
+#endif |
// Set all state that is different from the real state |
GLApi* temp = GetCurrentGLApi(); |