Chromium Code Reviews| 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 b8440dc009530511a66b0bc3962c79e57523656f..c644b99ab1534dd3ac4c540083b73ce681148d34 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -2256,30 +2256,35 @@ bool CompositedLayerMapping::interestRectChangedEnoughToRepaint(const IntRect& p |
| return false; |
| } |
| -void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect* interestRect) const |
| +IntRect CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect* interestRect) const |
| { |
| IntRect defaultInterestRect; |
| + IntRect previousInterestRect = graphicsLayer->previousInterestRect(); |
|
chrishtr
2015/11/16 23:29:40
If there were a method computeInterestRect and int
Xianzhu
2015/11/17 00:42:11
Done.
|
| if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { |
| if (!interestRect) { |
| if (graphicsLayer == m_graphicsLayer || graphicsLayer == m_squashingLayer) |
| defaultInterestRect = computeInterestRect(graphicsLayer, m_owningLayer.layoutObject()); |
| else |
| defaultInterestRect = enclosingIntRect(FloatRect(FloatPoint(), graphicsLayer->size())); |
| - interestRect = &defaultInterestRect; |
| + |
| + if (interestRectChangedEnoughToRepaint(previousInterestRect, defaultInterestRect, expandedIntSize(graphicsLayer->size()))) |
| + interestRect = &defaultInterestRect; |
| + else |
| + interestRect = &previousInterestRect; |
| } |
| if (!m_owningLayer.needsRepaint() |
| && !context.paintController().cacheIsEmpty() |
| - && !interestRectChangedEnoughToRepaint(m_previousPaintInterestRect, *interestRect, expandedIntSize(graphicsLayer->size()))) { |
| + && previousInterestRect == *interestRect) { |
| context.paintController().createAndAppend<CachedDisplayItem>(*this, DisplayItem::CachedDisplayItemList); |
| - return; |
| + return previousInterestRect; |
| } |
| - |
| - m_previousPaintInterestRect = *interestRect; |
| } |
| ASSERT(interestRect); |
| paintContentsInternal(graphicsLayer, context, graphicsLayerPaintingPhase, *interestRect); |
| + |
| + return *interestRect; |
| } |
| void CompositedLayerMapping::paintContentsInternal(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect& interestRect) const |