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

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

Issue 1877093002: Update PaintLayer::needsPaintPhaseXXX flags when add/remove layer on style change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 ## 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 ## Empty paint phase optimization
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 invalidation, we set the containing self-painting layer's `needsPai ntPhaseXXX`
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.
109
110 When layer structure changes, and we are not invalidate paint of the changed sub tree,
111 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob ject changes
112 style and creates a self-painting-layer, we copy the flags from its containing s elf-painting
113 layer to this layer, assuming that this layer needs all paint phases that its co ntainer
114 self-painting layer needs.
115
116 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that would regress
117 performance of the first paint. For slimming paint v2, we can update the flags d uring the
118 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