Commit 4760725f authored by Jeff Muizelaar's avatar Jeff Muizelaar
Browse files

Bug 1494924. SetPaintRect to GetBuildingRect(). r=mattwoodrow

Instead of setting the item PaintRect to paintBounds we intersect it with the
BuildingRect. This properly reduces the size based on clips and gives a big
performance improvement for clipped nsDisplayFilter items because we call
CreateSimiliar surface for the size of building rect instead of the bounds of
the item.

Differential Revision: https://phabricator.services.mozilla.com/D17179
parent da754b61
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2009,7 +2009,7 @@ WebRenderCommandBuilder::GenerateFallbackData(
  // e.g.: nsDisplayBoxShadowInner uses mPaintRect in Paint() and mPaintRect is
  // computed in nsDisplayBoxShadowInner::ComputeVisibility().
  nsRegion visibleRegion(paintBounds);
  aItem->SetPaintRect(paintBounds);
  aItem->SetPaintRect(aItem->GetBuildingRect().Intersect(paintBounds));
  aItem->ComputeVisibility(aDisplayListBuilder, &visibleRegion);

  const int32_t appUnitsPerDevPixel =