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 9187b0ba9ed49a9d287c91a905c75cd46244f9a0..d0cdd0b7d65191ac0b1c2ec801521d3cf5e297ae 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -2038,18 +2038,34 @@ void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P |
ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); |
} |
-void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const LayoutRect& previousPaintInvalidationRect, const LayoutRect& newPaintInvalidationRect) |
+struct InvalidateDisplayItemClientFunctor { |
+ void operator() (GraphicsLayer* layer) const |
+ { |
+ Vector<IntRect> layerPaintInvalidationRects; |
+ for (const auto& r : paintInvalidationRects) { |
+ IntRect intRect = enclosingIntRect(LayoutRect(r.location() + subpixelAccumulation, r.size())); |
+ intRect.move(-layer->offsetFromLayoutObject()); |
+ layerPaintInvalidationRects.append(intRect); |
+ } |
+ layer->invalidateDisplayItemClient(displayItemClient, invalidationReason, layerPaintInvalidationRects); |
+ } |
+ |
+ const DisplayItemClientWrapper& displayItemClient; |
+ PaintInvalidationReason invalidationReason; |
+ Vector<LayoutRect> paintInvalidationRects; |
+ LayoutSize subpixelAccumulation; |
+}; |
+ |
+void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const Vector<LayoutRect>& paintInvalidationRects) |
{ |
- ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) { |
- layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect)); |
- }, ApplyToContentLayers); |
+ InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInvalidationReason, paintInvalidationRects, m_owningLayer.subpixelAccumulation() }; |
+ ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); |
} |
-void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const LayoutRect& previousPaintInvalidationRect, const LayoutRect& newPaintInvalidationRect) |
+void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const Vector<LayoutRect>& paintInvalidationRects) |
{ |
- ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) { |
- layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect)); |
- }, ApplyToScrollingContentsLayer); |
+ InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInvalidationReason, paintInvalidationRects, m_owningLayer.subpixelAccumulation() }; |
+ ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentsLayer); |
} |
const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(const LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIndex) |