Bug 1356179 - Part 1: Roundout clip region to make sure we have enough space for mask/clip-path painting. r=mstange, a=gchang
authorcku <cku@mozilla.com>
Wed, 10 May 2017 15:42:17 +0800
changeset 581821 f823cd086b3c189da690291920de387f6290c16e
parent 581820 bf419245ae3ba826eeacda695d8eaa1af097123e
child 581822 00ee53863f3c04aab9273bc2758cd30e4bcf2c81
push id59898
push userfmarier@mozilla.com
push dateFri, 19 May 2017 23:56:54 +0000
reviewersmstange, gchang
bugs1356179
milestone54.0
Bug 1356179 - Part 1: Roundout clip region to make sure we have enough space for mask/clip-path painting. r=mstange, a=gchang MozReview-Commit-ID: 6hfOiCDq7ni
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -8037,19 +8037,21 @@ nsDisplayMask::PaintAsLayer(nsDisplayLis
                                                   mFrame,  mVisibleRect,
                                                   borderArea, aBuilder,
                                                   aManager,
                                                   mHandleOpacity);
 
   // Clip the drawing target by mVisibleRect, which contains the visible
   // region of the target frame and its out-of-flow and inflow descendants.
   gfxContext* context = aCtx->ThebesContext();
-  context->Clip(NSRectToSnappedRect(mVisibleRect,
-                                    mFrame->PresContext()->AppUnitsPerDevPixel(),
-                                    *aCtx->GetDrawTarget()));
+
+  Rect bounds =
+    NSRectToRect(mVisibleRect, mFrame->PresContext()->AppUnitsPerDevPixel());
+  bounds.RoundOut();
+  context->Clip(bounds);
 
   ComputeMaskGeometry(params);
 
   image::DrawResult result =
     nsSVGIntegrationUtils::PaintMaskAndClipPath(params);
 
   context->PopClip();