Bug 1232346 - Clarify ResolveForDraw's failure checking. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 14 Dec 2015 17:38:33 -0800
changeset 311678 5c539183aea46cbd7da212fc6fe98756a07b7610
parent 311677 8af23e77ba02a2160183eed86608b1c96adeaa6f
child 311679 86d03ae71ba2328da985d46af767e5b8a03aed01
push id5703
push userraliiev@mozilla.com
push dateMon, 07 Mar 2016 14:18:41 +0000
treeherdermozilla-beta@31e373ad5b5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1232346
milestone46.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 1232346 - Clarify ResolveForDraw's failure checking. - r=kamidphish
dom/canvas/WebGLContextDraw.cpp
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -42,17 +42,16 @@ public:
     ~ScopedResolveTexturesForDraw();
 };
 
 ScopedResolveTexturesForDraw::ScopedResolveTexturesForDraw(WebGLContext* webgl,
                                                            const char* funcName,
                                                            bool* const out_error)
     : mWebGL(webgl)
 {
-    //typedef nsTArray<WebGLRefPtr<WebGLTexture>> TexturesT;
     typedef decltype(WebGLContext::mBound2DTextures) TexturesT;
 
     const auto fnResolveAll = [this, funcName](const TexturesT& textures)
     {
         const auto len = textures.Length();
         for (uint32_t texUnit = 0; texUnit < len; ++texUnit) {
             WebGLTexture* tex = textures[texUnit];
             if (!tex)
@@ -67,26 +66,27 @@ ScopedResolveTexturesForDraw::ScopedReso
 
             mWebGL->BindFakeBlack(texUnit, tex->Target(), fakeBlack);
             mRebindRequests.push_back({texUnit, tex});
         }
 
         return true;
     };
 
-    *out_error = false;
+    bool ok = true;
+    ok &= fnResolveAll(mWebGL->mBound2DTextures);
+    ok &= fnResolveAll(mWebGL->mBoundCubeMapTextures);
+    ok &= fnResolveAll(mWebGL->mBound3DTextures);
+    ok &= fnResolveAll(mWebGL->mBound2DArrayTextures);
 
-    *out_error |= !fnResolveAll(mWebGL->mBound2DTextures);
-    *out_error |= !fnResolveAll(mWebGL->mBoundCubeMapTextures);
-    *out_error |= !fnResolveAll(mWebGL->mBound3DTextures);
-    *out_error |= !fnResolveAll(mWebGL->mBound2DArrayTextures);
-
-    if (*out_error) {
+    if (!ok) {
         mWebGL->ErrorOutOfMemory("%s: Failed to resolve textures for draw.", funcName);
     }
+
+    *out_error = !ok;
 }
 
 ScopedResolveTexturesForDraw::~ScopedResolveTexturesForDraw()
 {
     if (!mRebindRequests.size())
         return;
 
     gl::GLContext* gl = mWebGL->gl;