| 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..9662ec3a792947cfe5640cd6277e662a0db054cb 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -2030,7 +2030,9 @@ struct SetContentsNeedsDisplayInRectFunctor {
|
| // r is in the coordinate space of the layer's layout object
|
| void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason)
|
| {
|
| - ASSERT(!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
|
| + // TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
|
| + // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
| +
|
| SetContentsNeedsDisplayInRectFunctor functor = {
|
| enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
|
| invalidationReason
|
| @@ -2038,18 +2040,33 @@ 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
|
| + {
|
| + IntRect boundsOnLayer;
|
| + if (paintInvalidationRect) {
|
| + boundsOnLayer = enclosingIntRect(LayoutRect(paintInvalidationRect->location() + subpixelAccumulation, paintInvalidationRect->size()));
|
| + boundsOnLayer.move(-layer->offsetFromLayoutObject());
|
| + }
|
| + layer->invalidateDisplayItemClient(displayItemClient, invalidationReason, paintInvalidationRect ? &boundsOnLayer : nullptr);
|
| + }
|
| +
|
| + const DisplayItemClientWrapper& displayItemClient;
|
| + PaintInvalidationReason invalidationReason;
|
| + const LayoutRect* paintInvalidationRect;
|
| + LayoutSize subpixelAccumulation;
|
| +};
|
| +
|
| +void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const LayoutRect* paintInvalidationRect)
|
| {
|
| - ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) {
|
| - layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect));
|
| - }, ApplyToContentLayers);
|
| + InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInvalidationReason, paintInvalidationRect, 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 LayoutRect* paintInvalidationRect)
|
| {
|
| - ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect](GraphicsLayer* layer) {
|
| - layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect(newPaintInvalidationRect));
|
| - }, ApplyToScrollingContentsLayer);
|
| + InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInvalidationReason, paintInvalidationRect, m_owningLayer.subpixelAccumulation() };
|
| + ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentsLayer);
|
| }
|
|
|
| const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(const LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIndex)
|
|
|