Bug 1545889 - Don't ABORT_ON_ERROR for CONTEXT_LOST. r=lsalzman
authorJeff Gilbert <jgilbert@mozilla.com>
Sat, 20 Apr 2019 02:19:01 +0000
changeset 470290 790205e92ab5c54c36c0afc0d3a0dfb98434b530
parent 470289 4c5a5b50c951ff946b39c178b080762e63043111
child 470291 c4f25a740b967189ab6b42c9434c984ab143dd8d
push id83647
push userjgilbert@mozilla.com
push dateSat, 20 Apr 2019 02:21:27 +0000
treeherderautoland@790205e92ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1545889
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545889 - Don't ABORT_ON_ERROR for CONTEXT_LOST. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D28263
gfx/gl/GLContext.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2874,23 +2874,24 @@ void GLContext::AfterGLCall_Debug(const 
   }
 
   if (mDebugFlags & DebugFlagTrace) {
     printf_stderr("[gl:%p] < %s [%s]\n", this, funcName,
                   GLErrorToString(err).c_str());
   }
 
   if (err && !mLocalErrorScopeStack.size()) {
-    printf_stderr("[gl:%p] %s: Generated unexpected %s error.\n", this,
-                  funcName, GLErrorToString(err).c_str());
-
-    if (mDebugFlags & DebugFlagAbortOnError) {
-      MOZ_CRASH(
-          "Unexpected error with MOZ_GL_DEBUG_ABORT_ON_ERROR. (Run"
-          " with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
+    const auto errStr = GLErrorToString(err);
+    const auto text = nsPrintfCString("%s: Generated unexpected %s error", funcName, errStr.c_str());
+    printf_stderr("[gl:%p] %s.\n", this, text.BeginReading());
+
+    const bool abortOnError = mDebugFlags & DebugFlagAbortOnError;
+    if (abortOnError && err != LOCAL_GL_CONTEXT_LOST) {
+      gfxCriticalErrorOnce() << text.BeginReading();
+      MOZ_CRASH("Aborting... (Run with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
     }
   }
 }
 
 /*static*/
 void GLContext::OnImplicitMakeCurrentFailure(const char* const funcName) {
   gfxCriticalError() << "Ignoring call to " << funcName << " with failed"
                      << " mImplicitMakeCurrent.";