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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2832603002: Only store previous clip rects for PaintLayers that support subsequences. (Closed)
Patch Set: Created 3 years, 8 months 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/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 039a63448a6a8a8ad736045e68bf9cf0ce584d04..0a6cd48300b7e41f78ac9b20ab5826a3b42661dc 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -167,6 +167,9 @@ static bool ShouldCreateSubsequence(const PaintLayer& paint_layer,
if (context.Printing())
return false;
+ if (!paint_layer.SupportsSubsequenceCaching())
+ return false;
+
// Don't create subsequence for a composited layer because if it can be
// cached, we can skip the whole painting in GraphicsLayer::paint() with
// CachedDisplayItemList. This also avoids conflict of
@@ -185,20 +188,6 @@ static bool ShouldCreateSubsequence(const PaintLayer& paint_layer,
kPaintLayerPaintingOverlayScrollbars | kPaintLayerUncachedClipRects))
return false;
- // Create subsequence for only stacking contexts whose painting are atomic.
- // SVG is also painted atomically.
- if (!paint_layer.StackingNode()->IsStackingContext() &&
- !paint_layer.GetLayoutObject().IsSVGRoot())
- return false;
-
- // The layer doesn't have children. Subsequence caching is not worth because
- // normally the actual painting will be cheap.
- // SVG is also painted atomically.
- if (!PaintLayerStackingNodeIterator(*paint_layer.StackingNode(), kAllChildren)
- .Next() &&
- !paint_layer.GetLayoutObject().IsSVGRoot())
- return false;
-
// When in FOUC-avoidance mode, don't cache any subsequences, to avoid having
// to invalidate all of them when leaving this mode. There is an early-out in
// BlockPainter::paintContents that may result in nothing getting painted in
@@ -346,6 +335,7 @@ PaintResult PaintLayerPainter::PaintLayerContents(
SubsequenceRecorder::UseCachedSubsequenceIfPossible(context,
paint_layer_))
return result;
+ DCHECK(paint_layer_.SupportsSubsequenceCaching());
subsequence_recorder.emplace(context, paint_layer_);
} else {
should_clear_empty_paint_phase_flags = true;
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698