Bug 1243336: Don't push layers to tiles that are completely clipped out. r=jrmuizel draft
authorBas Schouten <bschouten@mozilla.com>
Fri, 12 Feb 2016 02:54:16 +0100
changeset 330609 a3ed1976b08f092dafa227573d34d61f073b1514
parent 330544 b2b9363f3edccd028f45e0db2860b2cc07cad913
child 514197 be7aba72b34287bcdcf14a4d60f2ac9454f04f8e
push id10782
push userbschouten@mozilla.com
push dateFri, 12 Feb 2016 01:54:26 +0000
reviewersjrmuizel
bugs1243336
milestone47.0a1
Bug 1243336: Don't push layers to tiles that are completely clipped out. r=jrmuizel MozReview-Commit-ID: HQhtze6O7st
gfx/2d/DrawTargetTiled.cpp
--- a/gfx/2d/DrawTargetTiled.cpp
+++ b/gfx/2d/DrawTargetTiled.cpp
@@ -308,26 +308,30 @@ DrawTargetTiled::Fill(const Path* aPath,
 void
 DrawTargetTiled::PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask,
                            const Matrix& aMaskTransform, const IntRect& aBounds,
                            bool aCopyBackground)
 {
   // XXX - not sure this is what we want or whether we want to continue drawing to a larger
   // intermediate surface, that would require tweaking the code in here a little though.
   for (size_t i = 0; i < mTiles.size(); i++) {
-    IntRect bounds = aBounds;
-    bounds.MoveBy(-mTiles[i].mTileOrigin);
-    mTiles[i].mDrawTarget->PushLayer(aOpaque, aOpacity, aMask, aMaskTransform, aBounds);
+    if (!mTiles[i].mClippedOut) {
+      IntRect bounds = aBounds;
+      bounds.MoveBy(-mTiles[i].mTileOrigin);
+      mTiles[i].mDrawTarget->PushLayer(aOpaque, aOpacity, aMask, aMaskTransform, aBounds, aCopyBackground);
+    }
   }
 }
 
 void
 DrawTargetTiled::PopLayer()
 {
   // XXX - not sure this is what we want or whether we want to continue drawing to a larger
   // intermediate surface, that would require tweaking the code in here a little though.
   for (size_t i = 0; i < mTiles.size(); i++) {
-    mTiles[i].mDrawTarget->PopLayer();
+    if (!mTiles[i].mClippedOut) {
+      mTiles[i].mDrawTarget->PopLayer();
+    }
   }
 }
 
 } // namespace gfx
 } // namespace mozilla