OLD | NEW |
1 # Platform paint code | 1 # Platform paint code |
2 | 2 |
3 This directory contains the implementation of display lists and display | 3 This directory contains the implementation of display lists and display |
4 list-based painting, except for code which requires knowledge of `core/` | 4 list-based painting, except for code which requires knowledge of `core/` |
5 concepts, such as DOM elements and layout objects. | 5 concepts, such as DOM elements and layout objects. |
6 | 6 |
7 This code is owned by the [paint team][paint-team-site]. | 7 This code is owned by the [paint team][paint-team-site]. |
8 | 8 |
9 Slimming Paint v2 is currently being implemented. Unlike Slimming Paint v1, SPv2 | 9 Slimming Paint v2 is currently being implemented. Unlike Slimming Paint v1, SPv2 |
10 represents its paint artifact not as a flat display list, but as a list of | 10 represents its paint artifact not as a flat display list, but as a list of |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 In practice, display item clients are generally subclasses of `LayoutObject`, | 86 In practice, display item clients are generally subclasses of `LayoutObject`, |
87 but can be other Blink objects which get painted, such as inline boxes and drag | 87 but can be other Blink objects which get painted, such as inline boxes and drag |
88 images. | 88 images. |
89 | 89 |
90 *** note | 90 *** note |
91 It is illegal for there to be two drawings with the same ID in a display item | 91 It is illegal for there to be two drawings with the same ID in a display item |
92 list. | 92 list. |
93 *** | 93 *** |
94 | 94 |
95 Generally, clients of this code should use stack-allocated recorder classes to | 95 Generally, clients of this code should use stack-allocated recorder classes to |
96 emit display items to a `DisplayItemList` (using `GraphicsContext`). | 96 emit display items to a `PaintController` (using `GraphicsContext`). |
97 | 97 |
98 ### Standalone display items | 98 ### Standalone display items |
99 | 99 |
100 #### [CachedDisplayItem](CachedDisplayItem.h) | 100 #### [CachedDisplayItem](CachedDisplayItem.h) |
101 | 101 |
102 The type `DisplayItem::CachedSubsequence` indicates that the previous frame's | 102 The type `DisplayItem::CachedSubsequence` indicates that the previous frame's |
103 display item list contains a contiguous sequence of display items which should | 103 display item list contains a contiguous sequence of display items which should |
104 be reused in place of this `CachedDisplayItem`. | 104 be reused in place of this `CachedDisplayItem`. |
105 | 105 |
106 *** note | 106 *** note |
(...skipping 12 matching lines...) Expand all Loading... |
119 ### Paired begin/end display items | 119 ### Paired begin/end display items |
120 | 120 |
121 *** aside | 121 *** aside |
122 TODO(jbroman): Describe how these work, once we've worked out what happens to | 122 TODO(jbroman): Describe how these work, once we've worked out what happens to |
123 them in SPv2. | 123 them in SPv2. |
124 *** | 124 *** |
125 | 125 |
126 ## Display item list | 126 ## Display item list |
127 | 127 |
128 Callers use `GraphicsContext` (via its drawing methods, and its | 128 Callers use `GraphicsContext` (via its drawing methods, and its |
129 `displayItemList()` accessor) and scoped recorder classes, which emit items into | 129 `paintController()` accessor) and scoped recorder classes, which emit items into |
130 a `DisplayItemList`. | 130 a `PaintController`. |
131 | 131 |
132 `DisplayItemList` is responsible for producing the paint artifact. It contains | 132 `PaintController` is responsible for producing the paint artifact. It contains |
133 the *current* paint artifact, which is always complete (i.e. it has no | 133 the *current* paint artifact, which is always complete (i.e. it has no |
134 `CachedDisplayItem` objects), and *new* display items and paint chunks, which | 134 `CachedDisplayItem` objects), and *new* display items and paint chunks, which |
135 are added as content is painted. | 135 are added as content is painted. |
136 | 136 |
137 When the new display items have been populated, clients call | 137 When the new display items have been populated, clients call |
138 `commitNewDisplayItems`, which merges the previous artifact with the new data, | 138 `commitNewDisplayItems`, which merges the previous artifact with the new data, |
139 producing a new paint artifact, where `CachedDisplayItem` objects have been | 139 producing a new paint artifact, where `CachedDisplayItem` objects have been |
140 replaced with the cached content from the previous artifact. | 140 replaced with the cached content from the previous artifact. |
141 | 141 |
142 At this point, the paint artifact is ready to be drawn or composited. | 142 At this point, the paint artifact is ready to be drawn or composited. |
143 | 143 |
144 *** aside | 144 *** aside |
145 TODO(jbroman): Explain invalidation. | 145 TODO(jbroman): Explain invalidation. |
146 *** | 146 *** |
OLD | NEW |