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..f3b8db88a12ac75abd023dc131d1c0ebe8bbdf0b 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -2256,30 +2256,39 @@ 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(); |
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; |
+ } else if (*interestRect != previousInterestRect) { |
+ WTFLogAlways("Requested interest rect (%d,%d,%d,%d) is different from previous painted interest rect (%d,%d,%d,%d).", |
+ interestRect->x(), interestRect->y(), interestRect->width(), interestRect->height(), |
+ previousInterestRect.x(), previousInterestRect.y(), previousInterestRect.width(), previousInterestRect.height()); |
Xianzhu
2015/11/14 00:36:17
The message indicates that there is performance pe
|
} |
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 |