Bug 1125445 - Only do backbuffer workaround if against backbuffer. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 26 Jan 2015 18:27:24 -0800
changeset 239537 dfe54b1d8ac2a32182d200c0c487ce5a9932e6ed
parent 239536 a389cb22000d943e1472c43916a93b3a5481ffce
child 239538 ef01cebd1e079541d0f59b72a92b66cbc0d10e4a
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewerskamidphish
bugs1125445
milestone38.0a1
Bug 1125445 - Only do backbuffer workaround if against backbuffer. - r=kamidphish
dom/canvas/WebGLContext.h
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1519,17 +1519,20 @@ protected:
 
     bool mNeedsFakeNoAlpha;
 
     struct ScopedMaskWorkaround {
         WebGLContext& mWebGL;
         const bool mNeedsChange;
 
         static bool NeedsChange(WebGLContext& webgl) {
-            return webgl.mNeedsFakeNoAlpha &&
+            // We should only be doing this if we're about to draw to the backbuffer, but
+            // the backbuffer needs to have this fake-no-alpha workaround.
+            return !webgl.mBoundDrawFramebuffer &&
+                   webgl.mNeedsFakeNoAlpha &&
                    webgl.mColorWriteMask[3] != false;
         }
 
         explicit ScopedMaskWorkaround(WebGLContext& webgl);
 
         ~ScopedMaskWorkaround();
     };