| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| index e4f5b18fb2b1b60eda7d99c92ecdb7a84c2130cb..a5dd1ce1e0ac31893481e511c6fc8c90a607ec11 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -2734,6 +2734,19 @@ struct SetContentsNeedsDisplayInRectFunctor {
|
| const DisplayItemClient& client;
|
| };
|
|
|
| +IntRect CompositedLayerMapping::adjustedInvalRect(const LayoutRect& r) const {
|
| + // Skia's hairline stroke may extend .5 units outside the computed path
|
| + // bounds. Pad defensively.
|
| + static constexpr float kInvalRectPadding = .5f;
|
| +
|
| + LayoutRect adjustedRect(r);
|
| + adjustedRect.inflate(LayoutUnit(kInvalRectPadding));
|
| + adjustedRect.intersect(m_compositedBounds);
|
| + adjustedRect.move(m_owningLayer.subpixelAccumulation());
|
| +
|
| + return enclosingIntRect(adjustedRect);
|
| +}
|
| +
|
| void CompositedLayerMapping::setContentsNeedDisplayInRect(
|
| const LayoutRect& r,
|
| PaintInvalidationReason invalidationReason,
|
| @@ -2743,10 +2756,8 @@ void CompositedLayerMapping::setContentsNeedDisplayInRect(
|
| // spv2 is ready.
|
| // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
|
|
| - SetContentsNeedsDisplayInRectFunctor functor = {
|
| - enclosingIntRect(LayoutRect(
|
| - r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
|
| - invalidationReason, client};
|
| + SetContentsNeedsDisplayInRectFunctor functor = {adjustedInvalRect(r),
|
| + invalidationReason, client};
|
| ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
|
| }
|
|
|
| @@ -2759,10 +2770,8 @@ void CompositedLayerMapping::setNonScrollingContentsNeedDisplayInRect(
|
| // spv2 is ready.
|
| // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
|
|
| - SetContentsNeedsDisplayInRectFunctor functor = {
|
| - enclosingIntRect(LayoutRect(
|
| - r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
|
| - invalidationReason, client};
|
| + SetContentsNeedsDisplayInRectFunctor functor = {adjustedInvalRect(r),
|
| + invalidationReason, client};
|
| ApplyToGraphicsLayers(this, functor, ApplyToNonScrollingContentLayers);
|
| }
|
|
|
| @@ -2775,10 +2784,8 @@ void CompositedLayerMapping::setScrollingContentsNeedDisplayInRect(
|
| // spv2 is ready.
|
| // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
|
|
| - SetContentsNeedsDisplayInRectFunctor functor = {
|
| - enclosingIntRect(LayoutRect(
|
| - r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
|
| - invalidationReason, client};
|
| + SetContentsNeedsDisplayInRectFunctor functor = {adjustedInvalRect(r),
|
| + invalidationReason, client};
|
| ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentLayers);
|
| }
|
|
|
|
|