Bug 1043426: Avoid doing work for empty visible regions. r=mattwoodrow
authorBas Schouten <bschouten@mozilla.com>
Mon, 04 Aug 2014 13:02:14 +0200
changeset 198064 d7e3d485cd8d242db7fdb22175dbd966217f0df7
parent 198063 d6f1a64f5ab0976841c83c831eb637447e8f31ac
child 198065 6fd7ebecfa9ffbdbe4830f767e0b64cb601e2479
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmattwoodrow
bugs1043426
milestone34.0a1
Bug 1043426: Avoid doing work for empty visible regions. r=mattwoodrow
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1008,17 +1008,17 @@ ContainerLayer::DefaultComputeEffectiveT
             useIntermediateSurface = true;
             break;
           }
         }
       }
     }
   }
 
-  mUseIntermediateSurface = useIntermediateSurface;
+  mUseIntermediateSurface = useIntermediateSurface && !GetEffectiveVisibleRegion().IsEmpty();
   if (useIntermediateSurface) {
     ComputeEffectiveTransformsForChildren(Matrix4x4::From2D(residual));
   } else {
     ComputeEffectiveTransformsForChildren(idealTransform);
   }
 
   if (idealTransform.CanDraw2D()) {
     ComputeEffectiveTransformForMaskLayer(aTransformToSurface);