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

Unified Diff: third_party/WebKit/Source/core/paint/README.md

Issue 1892473002: Update PaintLayer::needsPaintPhaseXXX flags when add/remove layer on style change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/README.md
diff --git a/third_party/WebKit/Source/core/paint/README.md b/third_party/WebKit/Source/core/paint/README.md
index b3516cd501f3a5c86cdc1c2ea030bd61b121f2b2..645b76cb2ab3ffb31b823641368cf47b492652d4 100644
--- a/third_party/WebKit/Source/core/paint/README.md
+++ b/third_party/WebKit/Source/core/paint/README.md
@@ -216,3 +216,29 @@ There are many conditions affecting
* whether we can use cached subsequence for a PaintLayer.
See `shouldCreateSubsequence()` and `shouldRepaintSubsequence()` in `PaintLayerPainter.cpp` for
the conditions.
+
+## Empty paint phase optimization
+
+During painting, we walk the layout tree multiple times for multiple paint phases. Sometimes
+a layer contain nothing needing a certain paint phase and we can skip tree walk for such
+empty phases. Now we have optimized `PaintPhaseDescendantBlockBackgroundsOnly`,
+`PaintPhaseDescendantOutlinesOnly` and `PaintPhaseFloat` for empty paint phases.
+
+During paint invalidation, we set the containing self-painting layer's `needsPaintPhaseXXX`
+flag if the object has something needing to be painted in the paint phase.
+
+During painting, we check the flag before painting a paint phase and skip the tree walk if
+the flag is not set.
+
+It's hard to clear a `needsPaintPhaseXXX` flag when a layer no longer needs the paint phase,
+so we never clear the flags.
+
+When layer structure changes, and we are not invalidate paint of the changed subtree,
+we need to manually update the `needsPaintPhaseXXX` flags. For example, if an object changes
+style and creates a self-painting-layer, we copy the flags from its containing self-painting
+layer to this layer, assuming that this layer needs all paint phases that its container
+self-painting layer needs.
+
+We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that would regress
+performance of the first paint. For slimming paint v2, we can update the flags during the
+pre-painting tree walk to simplify the logics.
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698