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

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..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

Powered by Google App Engine
This is Rietveld 408576698