OLD | NEW |
---|---|
1 # `Source/core/paint` | 1 # `Source/core/paint` |
2 | 2 |
3 This directory contains implementation of painters of layout objects. It covers | 3 This directory contains implementation of painters of layout objects. It covers |
4 the following document lifecycle states: | 4 the following document lifecycle states: |
5 | 5 |
6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) | 6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) |
7 * PrePaint (`InPrePaint` and `PrePaintClean`) | 7 * PrePaint (`InPrePaint` and `PrePaintClean`) |
8 * Paint (`InPaint` and `PaintClean`) | 8 * Paint (`InPaint` and `PaintClean`) |
9 | 9 |
10 ## Glossaries | 10 ## Glossaries |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 * The normal paint invalidation is based on whole LayoutObject's, not aware of the first line. | 194 * The normal paint invalidation is based on whole LayoutObject's, not aware of the first line. |
195 | 195 |
196 We have a special path for first line style change: the style system informs the layout system | 196 We have a special path for first line style change: the style system informs the layout system |
197 when the computed first-line style changes through `LayoutObject::firstLineStyle DidChange()`. | 197 when the computed first-line style changes through `LayoutObject::firstLineStyle DidChange()`. |
198 When this happens, we invalidate all `InlineBox`es in the first line. | 198 When this happens, we invalidate all `InlineBox`es in the first line. |
199 | 199 |
200 ### Slimming paint v2 | 200 ### Slimming paint v2 |
201 | 201 |
202 TODO(wangxianzhu): add details | 202 TODO(wangxianzhu): add details |
203 | 203 |
204 ## [`PrePaintTreeWalk`](PrePaintTreeWalk.h) (Slimming paint v2 only) | 204 ## [`PrePaintTreeWalk`](PrePaintTreeWalk.h) (Slimming Paint invalidaiton/v2 only ) |
205 | 205 |
206 During `InPrePaint` document lifecycle state, this class is called to walk the w hole | 206 During `InPrePaint` document lifecycle state, this class is called to walk the w hole |
207 layout tree, beginning from the root FrameView, across frame boundaries. We do t he | 207 layout tree, beginning from the root FrameView, across frame boundaries. We do t he |
208 following during the tree walk: | 208 following during the tree walk: |
209 | 209 |
210 * Building paint property tree: creates paint property tree nodes for special | 210 ### Building paint property trees (`PaintPropertyTreeBuilder`](PaintPropertyTree Builder.h) |
211 things in the layout tree, including but not limit to: overflow clip, transf orm, | |
212 fixed-pos, animation, mask, filter, etc. Also sets direct compositing reason s to be | |
213 used later for compositing. | |
214 | 211 |
215 * Paint invalidation: Not implemented yet. TODO(wangxianzhu): add details afte r | 212 This class is responsible for building property trees |
pdr.
2017/04/28 23:13:40
Nit: please fix the column wrapping.
chrishtr
2017/05/02 00:55:55
Done.
| |
216 it's implemented. | 213 (see [the platform paint README file](../../platform/graphics/paint/README.md)). |
214 | |
215 Each `PaintLayer`'s `LayoutObject` has one or more `FragmentData` objects (see | |
216 below for more on fragments). Every `FragmentData` has an `ObjectPaintProperties ` object if any property nodes | |
217 are induced by it. For example, if the object has a transform, its `ObjectPaintP roperties::Transform()` | |
218 field points at the `TransformPaintPropertyNode` representing that transform. | |
219 | |
220 The `NeedsPaintPropertyUpdate`, `SubtreeNeedsPaintPropertyUpdate` and `Descendan tNeedsPaintPropertyUpdate` | |
221 dirty bits on `LayoutObject` control how much of the layout tree is traversed du ring each `PrePaintTreeWalk`. | |
222 | |
223 #### Fragments | |
224 | |
225 In the absence of multicolumn/pagination, there is a 1:1 correspondence betwen | |
pdr.
2017/04/28 23:13:41
between
chrishtr
2017/05/02 00:55:55
Done
| |
226 self-painting `PaintLayer`s and `FragmentData`. If there is multicolumn/paginati on, there | |
227 may be more fragments. If a `PaintLayer` has a property node, each of its fragme nts will have | |
pdr.
2017/04/28 23:13:40
... may be more `FragmentData`s.
chrishtr
2017/05/02 00:55:55
Done.
| |
228 one. The parent of a fragment's property node is the property node that belongs to the ancestor | |
229 `PaintLayer` which part of the same column. For example, if there are 3 columns and both | |
pdr.
2017/04/28 23:13:40
...which [is] part...
chrishtr
2017/05/02 00:55:56
Done.
| |
230 a parent and child `PaintLayer` have a transform, there wil be 3 `FragmentData` | |
pdr.
2017/04/28 23:13:41
will
chrishtr
2017/05/02 00:55:56
Done.
| |
231 objects for the parent, 3 for the child, each `FragmentData` will have its own | |
232 `TransformPaintPropertyNode`, and the child's ith fragment's transform will poin t to the ith | |
233 parent's transform. | |
234 | |
235 See [`LayoutMultiColumnFlowThread.h`](../layout/LayoutMultiColumnFlowThread.h) | |
236 for a much more detail about multicolumn/pagination. | |
237 | |
238 ### Paint invalidation: `PaintInvalidator` implements a tree walk that perform s | |
239 paint invalidation. TODO(wangxianzhu): expand on this. | |
240 | |
241 # [`PaintPropertyTreeBuilder`](PaintPropertyTreeBuilder.h) (Slimming Paint inval idation only) | |
242 | |
217 | 243 |
218 ## Paint result caching | 244 ## Paint result caching |
219 | 245 |
220 `PaintController` holds the previous painting result as a cache of display items . | 246 `PaintController` holds the previous painting result as a cache of display items . |
221 If some painter would generate results same as those of the previous painting, | 247 If some painter would generate results same as those of the previous painting, |
222 we'll skip the painting and reuse the display items from cache. | 248 we'll skip the painting and reuse the display items from cache. |
223 | 249 |
224 ### Display item caching | 250 ### Display item caching |
225 | 251 |
226 When a painter would create a `DrawingDisplayItem` exactly the same as the displ ay item | 252 When a painter would create a `DrawingDisplayItem` exactly the same as the displ ay item |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 | 294 |
269 When layer structure changes, and we are not invalidate paint of the changed sub tree, | 295 When layer structure changes, and we are not invalidate paint of the changed sub tree, |
270 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob ject changes | 296 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob ject changes |
271 style and creates a self-painting-layer, we copy the flags from its containing s elf-painting | 297 style and creates a self-painting-layer, we copy the flags from its containing s elf-painting |
272 layer to this layer, assuming that this layer needs all paint phases that its co ntainer | 298 layer to this layer, assuming that this layer needs all paint phases that its co ntainer |
273 self-painting layer needs. | 299 self-painting layer needs. |
274 | 300 |
275 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that would regress | 301 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that would regress |
276 performance of the first paint. For slimming paint v2, we can update the flags d uring the | 302 performance of the first paint. For slimming paint v2, we can update the flags d uring the |
277 pre-painting tree walk to simplify the logics. | 303 pre-painting tree walk to simplify the logics. |
OLD | NEW |