Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1441973003: Use recomputed interest rect only if it changed enough (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698