| 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 e9ff85796c123d3768c11ef81048390a6f1f42b8..eaa7c4c506ab677383ce2cae403b6f0de2d5067f 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -2052,33 +2052,41 @@ void CompositedLayerMapping::setContentsNeedDisplay()
|
| ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToContentLayers);
|
| }
|
|
|
| -struct SetContentsNeedsDisplayInRectFunctor {
|
| - void operator() (GraphicsLayer* layer) const
|
| - {
|
| - if (layer->drawsContent()) {
|
| - IntRect layerDirtyRect = r;
|
| - layerDirtyRect.move(-layer->offsetFromLayoutObject());
|
| - layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason, client);
|
| - }
|
| - }
|
| -
|
| - IntRect r;
|
| - PaintInvalidationReason invalidationReason;
|
| - const DisplayItemClient& client;
|
| -};
|
| -
|
| // r is in the coordinate space of the layer's layout object
|
| void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason, const DisplayItemClient& client)
|
| {
|
| // TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
|
| // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
|
|
| - SetContentsNeedsDisplayInRectFunctor functor = {
|
| + NeedsDisplayRecord record {
|
| enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
|
| invalidationReason,
|
| client
|
| };
|
| - ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
|
| +
|
| + m_needsDisplayInRects.append(record);
|
| +}
|
| +
|
| +struct SetContentsNeedsDisplayInRectsFunctor {
|
| + void operator()(GraphicsLayer* layer) const
|
| + {
|
| + if (layer->drawsContent()) {
|
| + layer->setNeedsDisplayInRect(needsDisplayInRects);
|
| + }
|
| + }
|
| +
|
| + const Vector<NeedsDisplayRecord>& needsDisplayInRects;
|
| +};
|
| +
|
| +void CompositedLayerMapping::finalizeInvalidations()
|
| +{
|
| + if (m_needsDisplayInRects.size()) {
|
| + SetContentsNeedsDisplayInRectsFunctor functor = {
|
| + m_needsDisplayInRects
|
| + };
|
| + ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
|
| + m_needsDisplayInRects.clear();
|
| + }
|
| }
|
|
|
| void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient& displayItemClient, PaintInvalidationReason paintInvalidationReason)
|
|
|