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 243097 eea6117858b5
parent 243096 608e290ece63
child 243098 e25b169e456b
push id4402
push userryanvm@gmail.com
push date2015-01-29 16:16 +0000
treeherdermozilla-beta@e25b169e456b [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();
     };