Bug 1382185 - Check the status of GLContext::MakeCurrent in TexUnpackBlob.cpp. r=jgilber
authorNicolas Silva <nsilva@mozilla.com>
Mon, 24 Jul 2017 12:24:25 +0200
changeset 421688 7764f3432bac5a10eab4d103930f972528054e1e
parent 421687 7928b9c4f4c3edc1087e220122e4a09e409d4b82
child 421689 c1b154630587a9e91b67a6ab40890a382aebec54
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilber
bugs1382185
milestone56.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 1382185 - Check the status of GLContext::MakeCurrent in TexUnpackBlob.cpp. r=jgilber
dom/canvas/TexUnpackBlob.cpp
--- a/dom/canvas/TexUnpackBlob.cpp
+++ b/dom/canvas/TexUnpackBlob.cpp
@@ -882,17 +882,20 @@ TexUnpackSurface::TexOrSubImage(bool isS
                          srcStride, dstFormat, dstStride, &dstBegin, &tempBuffer))
     {
         return false;
     }
 
     ////
 
     const auto& gl = webgl->gl;
-    MOZ_ALWAYS_TRUE( gl->MakeCurrent() );
+    if (!gl->MakeCurrent()) {
+        *out_error = LOCAL_GL_CONTEXT_LOST;
+        return true;
+    }
 
     gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, dstAlignment);
     if (webgl->IsWebGL2()) {
         gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, rowLength);
     }
 
     *out_error = DoTexOrSubImage(isSubImage, gl, target.get(), level, dui, xOffset,
                                  yOffset, zOffset, mWidth, mHeight, mDepth, dstBegin);