Bug 1243336: Don't push layers to tiles that are completely clipped out. r=jrmuizel
MozReview-Commit-ID: HQhtze6O7st
--- 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