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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainterTest.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 ## Glossaries 5 ## Glossaries
6 6
7 ### Stacked elements and stacking contexts 7 ### Stacked elements and stacking contexts
8 8
9 This chapter is basically a clarification of [CSS 2.1 appendix E. Elaborate desc ription 9 This chapter is basically a clarification of [CSS 2.1 appendix E. Elaborate desc ription
10 of Stacking Contexts](http://www.w3.org/TR/CSS21/zindex.html). 10 of Stacking Contexts](http://www.w3.org/TR/CSS21/zindex.html).
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 In a subsequence paint, if the layer would generate exactly the same display ite ms, we'll simply 209 In a subsequence paint, if the layer would generate exactly the same display ite ms, we'll simply
210 output a `CachedSubsequence` display item in place of the display items, and ski p all paintings 210 output a `CachedSubsequence` display item in place of the display items, and ski p all paintings
211 of the layer and its descendants in painting order. After painting, `PaintContro ller` will 211 of the layer and its descendants in painting order. After painting, `PaintContro ller` will
212 replace `CacheSubsequence` with cached display items created in previous paintin gs. 212 replace `CacheSubsequence` with cached display items created in previous paintin gs.
213 213
214 There are many conditions affecting 214 There are many conditions affecting
215 * whether we need to generate subsequence for a PaintLayer; 215 * whether we need to generate subsequence for a PaintLayer;
216 * whether we can use cached subsequence for a PaintLayer. 216 * whether we can use cached subsequence for a PaintLayer.
217 See `shouldCreateSubsequence()` and `shouldRepaintSubsequence()` in `PaintLayerP ainter.cpp` for 217 See `shouldCreateSubsequence()` and `shouldRepaintSubsequence()` in `PaintLayerP ainter.cpp` for
218 the conditions. 218 the conditions.
219
220 ## Empty paint phase optimization
221
222 During painting, we walk the layout tree multiple times for multiple paint phase s. Sometimes
223 a layer contain nothing needing a certain paint phase and we can skip tree walk for such
224 empty phases. Now we have optimized `PaintPhaseDescendantBlockBackgroundsOnly`,
225 `PaintPhaseDescendantOutlinesOnly` and `PaintPhaseFloat` for empty paint phases.
226
227 During paint invalidation, we set the containing self-painting layer's `needsPai ntPhaseXXX`
228 flag if the object has something needing to be painted in the paint phase.
229
230 During painting, we check the flag before painting a paint phase and skip the tr ee walk if
231 the flag is not set.
232
233 It's hard to clear a `needsPaintPhaseXXX` flag when a layer no longer needs the paint phase,
234 so we never clear the flags.
235
236 When layer structure changes, and we are not invalidate paint of the changed sub tree,
237 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob ject changes
238 style and creates a self-painting-layer, we copy the flags from its containing s elf-painting
239 layer to this layer, assuming that this layer needs all paint phases that its co ntainer
240 self-painting layer needs.
241
242 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that would regress
243 performance of the first paint. For slimming paint v2, we can update the flags d uring the
244 pre-painting tree walk to simplify the logics.
OLDNEW
« 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