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 396299 f823cd086b3c189da690291920de387f6290c16e
parent 396298 bf419245ae3ba826eeacda695d8eaa1af097123e
child 396300 00ee53863f3c04aab9273bc2758cd30e4bcf2c81
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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();