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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 which defines the coordinate space in which the content should be painted. | 46 which defines the coordinate space in which the content should be painted. |
47 | 47 |
48 Each transform node has: | 48 Each transform node has: |
49 | 49 |
50 * a 4x4 [`TransformationMatrix`](../../transforms/TransformationMatrix.h) | 50 * a 4x4 [`TransformationMatrix`](../../transforms/TransformationMatrix.h) |
51 * a 3-dimensional transform origin, which defines the origin relative to which | 51 * a 3-dimensional transform origin, which defines the origin relative to which |
52 the transformation matrix should be applied (e.g. a rotation applied with some | 52 the transformation matrix should be applied (e.g. a rotation applied with some |
53 transform origin will rotate the plane about that point) | 53 transform origin will rotate the plane about that point) |
54 * a pointer to the parent node, which defines the coordinate space relative to | 54 * a pointer to the parent node, which defines the coordinate space relative to |
55 which the above should be interpreted | 55 which the above should be interpreted |
| 56 * a boolean indicating whether the transform should be projected into the plane |
| 57 of its parent (i.e., whether the total transform inherited from its parent |
| 58 should be flattened before this node's transform is applied and propagated to |
| 59 children) |
| 60 * an integer rendering context ID; content whose transform nodes share a |
| 61 rendering context ID should sort together |
56 | 62 |
57 The parent node pointers link the transform nodes in a hierarchy (the *transform | 63 The parent node pointers link the transform nodes in a hierarchy (the *transform |
58 tree*), which defines how the transform for any painted content can be | 64 tree*), which defines how the transform for any painted content can be |
59 determined. | 65 determined. |
60 | 66 |
61 ***promo | 67 ***promo |
62 The painting system may create transform nodes which don't affect the position | 68 The painting system may create transform nodes which don't affect the position |
63 of points in the xy-plane, but which have an apparent effect only when | 69 of points in the xy-plane, but which have an apparent effect only when |
64 multiplied with other transformation matrices. In particular, a transform node | 70 multiplied with other transformation matrices. In particular, a transform node |
65 may be created to establish a perspective matrix for descendant transforms in | 71 may be created to establish a perspective matrix for descendant transforms in |
66 order to create the illusion of depth. | 72 order to create the illusion of depth. |
67 *** | 73 *** |
68 | 74 |
69 *** aside | 75 Note that, even though CSS does not permit it in the DOM, the transform tree can |
70 TODO(jbroman): Explain flattening, etc., once it exists in the paint properties. | 76 have nodes whose children do not flatten their inherited transform and |
71 *** | 77 participate in no 3D rendering context. For example, not flattening is necessary |
| 78 to preserve the 3D character of the perspective transform, but this does not |
| 79 imply any 3D sorting. |
72 | 80 |
73 ### Clips | 81 ### Clips |
74 | 82 |
75 Each paint chunk is associated with a [clip node](ClipPaintPropertyNode.h), | 83 Each paint chunk is associated with a [clip node](ClipPaintPropertyNode.h), |
76 which defines the raster region that will be applied on the canvas when | 84 which defines the raster region that will be applied on the canvas when |
77 the chunk is rastered. | 85 the chunk is rastered. |
78 | 86 |
79 Each clip node has: | 87 Each clip node has: |
80 | 88 |
81 * A float rect with (optionally) rounded corner radius. | 89 * A float rect with (optionally) rounded corner radius. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 visual and transformed rects of display items in the coordinate space of ancesto
r | 249 visual and transformed rects of display items in the coordinate space of ancesto
r |
242 [`PropertyTreeState`](PropertyTreeState.h)s. | 250 [`PropertyTreeState`](PropertyTreeState.h)s. |
243 | 251 |
244 The transformed rect of a display item in an ancestor `PropertyTreeState` is tha
t | 252 The transformed rect of a display item in an ancestor `PropertyTreeState` is tha
t |
245 rect, multiplied by the transforms between the display item's `PropertyTreeState
` | 253 rect, multiplied by the transforms between the display item's `PropertyTreeState
` |
246 and the ancestors, then flattened into 2D. | 254 and the ancestors, then flattened into 2D. |
247 | 255 |
248 The visual rect of a display item in an ancestor `PropertyTreeState` is the inte
rsection | 256 The visual rect of a display item in an ancestor `PropertyTreeState` is the inte
rsection |
249 of all of the intermediate clips (transformed in to the ancestor state), with | 257 of all of the intermediate clips (transformed in to the ancestor state), with |
250 the display item's transformed rect. | 258 the display item's transformed rect. |
OLD | NEW |