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 419286 7764f3432bac5a10eab4d103930f972528054e1e
parent 419285 7928b9c4f4c3edc1087e220122e4a09e409d4b82
child 419287 c1b154630587a9e91b67a6ab40890a382aebec54
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [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);