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

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

Issue 2810503002: Only store previous clip rects for PaintLayers that support subsequences. (Closed)
Patch Set: none 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 55fb538a6da2e7fa5b14838cc7dda874cbc6554c..e7e9bcf0cd1aa64d432137b5fbb40f13bdaa8732 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

Powered by Google App Engine
This is Rietveld 408576698