Bug 1077358 - Clip BasicColorLayer drawing to the layer's bounds. r=Bas
authorMarkus Stange <mstange@themasta.com>
Tue, 07 Oct 2014 16:18:01 +0200
changeset 209183 22d7b9f148907b4f97aad05fcae695a66551b028
parent 209182 bb80c2b08bc0de837f72d39e6574015d897abeac
child 209184 ad40e2248efa8e8396b49bcb3814ec47e399d85d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersBas
bugs1077358
milestone35.0a1
Bug 1077358 - Clip BasicColorLayer drawing to the layer's bounds. r=Bas
gfx/layers/basic/BasicColorLayer.cpp
--- a/gfx/layers/basic/BasicColorLayer.cpp
+++ b/gfx/layers/basic/BasicColorLayer.cpp
@@ -57,19 +57,22 @@ public:
 
     Rect snapped(mBounds.x, mBounds.y, mBounds.width, mBounds.height);
     if (UserToDevicePixelSnapped(snapped, aDT->GetTransform())) {
       Matrix mat = aDT->GetTransform();
       mat.Invert();
       snapped = mat.TransformBounds(snapped);
     }
 
+    // Clip drawing in case we're using (unbounded) operator source.
+    aDT->PushClipRect(snapped);
     FillRectWithMask(aDT, aDeviceOffset, snapped, ToColor(mColor),
                      DrawOptions(GetEffectiveOpacity(), GetEffectiveOperator(this)),
                      aMaskLayer);
+    aDT->PopClip();
   }
 
 protected:
   BasicLayerManager* BasicManager()
   {
     return static_cast<BasicLayerManager*>(mManager);
   }
 };