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

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

Issue 2285633005: Reland of Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 c3912685d6caabedbda5b49e3dbb73caf401a385..e0066f66536c76d42b57abbe4d48c6c942ba0021 100644
--- a/third_party/WebKit/Source/core/paint/README.md
+++ b/third_party/WebKit/Source/core/paint/README.md
@@ -247,7 +247,16 @@ During painting, we check the flag before painting a paint phase and skip the tr
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.
+so we never clear the flags. Instead, we use another set of flags (`previousPaintPhaseXXXWasEmpty`)
+to record if a painting of a phase actually produced nothing. We'll skip the next
+painting of the phase if the flag is set, regardless of the corresponding
+`needsPaintPhaseXXX` flag. We will clear the `previousPaintPhaseXXXWasEmpty` flags when
+we paint with different clipping, scroll offset or interest rect from the previous paint.
+
+We don't clear the `previousPaintPhaseXXXWasEmpty` flags when the layer is marked `needsRepaint`.
+Instead we clear the flag when the corresponding `needsPaintPhaseXXX` is set. This ensures that
+we won't clear `previousPaintPhaseXXXWasEmpty` flags when unrelated things changed which won't
+cause the paint phases to become non-empty.
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
« 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