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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.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/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 2736ebb03cb8a76dc7c9d136bdc40fd8f0963dc7..7100c617d45d4d9dd7ab901aaf3503bd6d934b02 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2748,6 +2748,24 @@ bool PaintLayer::PaintsWithTransform(
GetCompositingState() != kPaintsIntoOwnBacking);
}
+bool PaintLayer::SupportsSubsequenceCaching() const {
+ // SVG paints atomically.
+ if (GetLayoutObject().IsSVGRoot())
+ return true;
+
+ // Create subsequence for only stacking contexts whose painting are atomic.
+ if (!StackingNode()->IsStackingContext())
+ return false;
+
+ // The layer doesn't have children. Subsequence caching is not worth it,
+ // because normally the actual painting will be cheap.
+ // SVG is also painted atomically.
+ if (!PaintLayerStackingNodeIterator(*StackingNode(), kAllChildren).Next())
+ return false;
+
+ return true;
+}
+
ScrollingCoordinator* PaintLayer::GetScrollingCoordinator() {
Page* page = GetLayoutObject().GetFrame()->GetPage();
return (!page) ? nullptr : page->GetScrollingCoordinator();
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698