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 576025 041b21c8d3265b97ff28b63114650abba76c6e15
parent 575938 d8762cb967423618ff0a488f14745f60964e5c49
child 576026 fdded13c2644fba96d87859b64d8467014316abb
child 576036 3cb75f3b217b159b3170e94d1329b8ce4e8c3b45
child 576053 0957b2cf3fdee7ffc3771ed91d633a422de7eb3d
push id58245
push userbmo:cku@mozilla.com
push dateThu, 11 May 2017 07:55:58 +0000
bugs1356179
milestone55.0a1
Bug 1356179 - Part 1. Roundout clip region to make sure we have enough space for mask/clip-path painting. MozReview-Commit-ID: 6hfOiCDq7ni
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -8524,19 +8524,21 @@ nsDisplayMask::PaintAsLayer(nsDisplayLis
                                                   mFrame,  mVisibleRect,
                                                   borderArea, aBuilder,
                                                   aManager,
                                                   mHandleOpacity, flags);
 
   // 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();