Bug 1410583 - Take clipped-bounds as the paint region for blob image. r=jrmuizel draft
authorEthan Lin <ethlin@mozilla.com>
Mon, 23 Oct 2017 13:12:15 +0800
changeset 684584 e923a9ec7a74c9c58405ef663d67e04e789a43ec
parent 684511 ce1a86d3b4db161c95d1147676bbed839d7a4732
child 736899 d5fd5c51f79b5f315166496f9e841fe9bb80e931
push id85654
push userbmo:ethlin@mozilla.com
push dateMon, 23 Oct 2017 05:15:10 +0000
reviewersjrmuizel
bugs1410583
milestone58.0a1
Bug 1410583 - Take clipped-bounds as the paint region for blob image. r=jrmuizel MozReview-Commit-ID: BfikzUttadC
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -427,24 +427,17 @@ WebRenderCommandBuilder::GenerateFallbac
                                               const StackingContextHelper& aSc,
                                               nsDisplayListBuilder* aDisplayListBuilder,
                                               LayoutDeviceRect& aImageRect)
 {
   RefPtr<WebRenderFallbackData> fallbackData = CreateOrRecycleWebRenderUserData<WebRenderFallbackData>(aItem);
 
   bool snap;
   nsRect itemBounds = aItem->GetBounds(aDisplayListBuilder, &snap);
-  nsRect clippedBounds = itemBounds;
-
-  const DisplayItemClip& clip = aItem->GetClip();
-  // Blob images will only draw the visible area of the blob so we don't need to clip
-  // them here and can just rely on the webrender clipping.
-  if (clip.HasClip() && !gfxPrefs::WebRenderBlobImages()) {
-    clippedBounds = itemBounds.Intersect(clip.GetClipRect());
-  }
+  nsRect clippedBounds = aItem->GetClippedBounds(aDisplayListBuilder);
 
   // nsDisplayItem::Paint() may refer the variables that come from ComputeVisibility().
   // So we should call RecomputeVisibility() before painting. e.g.: nsDisplayBoxShadowInner
   // uses mVisibleRegion in Paint() and mVisibleRegion is computed in
   // nsDisplayBoxShadowInner::ComputeVisibility().
   nsRegion visibleRegion(clippedBounds);
   aItem->RecomputeVisibility(aDisplayListBuilder, &visibleRegion);