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

Side by Side Diff: third_party/WebKit/Source/core/paint/README.md

Issue 1739893006: Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # `Source/core/paint` 1 # `Source/core/paint`
2 2
3 This directory contains implementation of painters of layout objects. 3 This directory contains implementation of painters of layout objects.
4 4
5 ## Painters 5 ## Painters
6 6
7 ## Paint invalidation 7 ## Paint invalidation
8 8
9 Paint invalidation marks anything that need to be painted differently from the o riginal 9 Paint invalidation marks anything that need to be painted differently from the o riginal
10 cached painting. 10 cached painting.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 In a subsequence paint, if the layer would generate exactly the same display ite ms, we'll simply 83 In a subsequence paint, if the layer would generate exactly the same display ite ms, we'll simply
84 output a `CachedSubsequence` display item in place of the display items, and ski p all paintings 84 output a `CachedSubsequence` display item in place of the display items, and ski p all paintings
85 of the layer and its descendants in painting order. After painting, `PaintContro ller` will 85 of the layer and its descendants in painting order. After painting, `PaintContro ller` will
86 replace `CacheSubsequence` with cached display items created in previous paintin gs. 86 replace `CacheSubsequence` with cached display items created in previous paintin gs.
87 87
88 There are many conditions affecting 88 There are many conditions affecting
89 * whether we need to generate subsequence for a PaintLayer; 89 * whether we need to generate subsequence for a PaintLayer;
90 * whether we can use cached subsequence for a PaintLayer. 90 * whether we can use cached subsequence for a PaintLayer.
91 See `shouldCreateSubsequence()` and `shouldRepaintSubsequence()` in `PaintLayerP ainter.cpp` for 91 See `shouldCreateSubsequence()` and `shouldRepaintSubsequence()` in `PaintLayerP ainter.cpp` for
92 the conditions. 92 the conditions.
93
94 ## Optimization for empty paint phases
95
96 During painting, we walk the layout tree multiple times for multiple paint phase s. Sometimes
97 a layer contain nothing needing a certain paint phase and we can skip tree walk for such
98 empty phases. Now we have optimized `PaintPhaseDescendantBlockBackgroundsOnly`,
99 `PaintPhaseDescendantOutlinesOnly` and `PaintPhaseFloat` for empty paint phases.
100
101 During paint invaliidation, we set the containing self-painting layer's `needsPa intPhaseXXX`
102 flag if the object has something needing to be painted in the paint phase.
103
104 During painting, we check the flag before painting a paint phase and skip the tr ee walk if
105 the flag is not set.
106
107 It's hard to clear a `needsPaintPhaseXXX` flag when a layer no longer needs the paint phase,
108 so we never clear the flags. Instead, we use another set of flags (`previousPain tPhaseXXXWasEmpty`)
109 to record if a painting of a phase actually produced nothing. We'll skip the nex t
110 painting of the phase if the flag is set, regardless of the corresponding
111 `needsPaintPhaseXXX` flag. We will clear the `previousPaintPhaseXXXWasEmpty` fla gs when
112 we paint with different clipping, scroll offset or interest rect from the previo us paint.
113
114 We don't clear the `previousPaintPhaseXXXWasEmpty` flags when the layer is marke d `needsRepaint`.
115 Instead we clear the flag when the corresponding `needsPaintPhaseXXX` is set. Th is ensures that
116 we won't clear `previousPaintPhaseXXXWasEmpty` flags when unrelated things chang ed which won't
117 cause the paint phases to become non-empty.
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698