Bug 1125445 - Only do backbuffer workaround if against backbuffer. r=kamidphish, a=sledru
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 27 Jan 2015 13:37:00 -0500
changeset 236901 eea6117858b50676c8faa436cf8af37ceeed35d3
parent 236900 608e290ece63511c74e3ee3e5665a34499e77592
child 236902 e25b169e456b4ef613c82994b64574abc5627a09
push id208
push userryanvm@gmail.com
push dateMon, 23 Feb 2015 15:44:39 +0000
treeherdermozilla-b2g37_v2_2@09dafeb43234 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish, sledru
bugs1125445
milestone36.0
Bug 1125445 - Only do backbuffer workaround if against backbuffer. r=kamidphish, a=sledru
dom/canvas/WebGLContext.h
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1459,17 +1459,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.mBoundFramebuffer &&
+                   webgl.mNeedsFakeNoAlpha &&
                    webgl.mColorWriteMask[3] != false;
         }
 
         explicit ScopedMaskWorkaround(WebGLContext& webgl);
 
         ~ScopedMaskWorkaround();
     };