Bug 1356179 - Part 1. Roundout clip region to make sure we have enough space for mask/clip-path painting. draft
authorcku <cku@mozilla.com>
Wed, 10 May 2017 15:42:17 +0800
changeset 578501 779be1f13cb996f18cc08abca120dc4c3af86a88
parent 578500 6b174b41fa44963901d4f09597bd97f60e8e9076
child 578502 237bf3b70627287d7c597ead709f340d01aea4a9
push id58939
push userbmo:cku@mozilla.com
push dateTue, 16 May 2017 04:17:59 +0000
bugs1356179
milestone52.1.2
Bug 1356179 - Part 1. Roundout clip region to make sure we have enough space for mask/clip-path painting. MozReview-Commit-ID: 6hfOiCDq7ni
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -7219,19 +7219,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();