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

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

Issue 2330863003: Switch to null root property tree nodes [spv2] (Closed)
Patch Set: Rebase from space Created 4 years, 3 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
OLDNEW
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 13 matching lines...) Expand all
24 24
25 ## Paint properties 25 ## Paint properties
26 26
27 Paint properties define characteristics of how a paint chunk should be drawn, 27 Paint properties define characteristics of how a paint chunk should be drawn,
28 such as the transform it should be drawn with. To enable efficient updates, 28 such as the transform it should be drawn with. To enable efficient updates,
29 a chunk's paint properties are described hierarchically. For instance, each 29 a chunk's paint properties are described hierarchically. For instance, each
30 chunk is associated with a transform node, whose matrix should be multiplied by 30 chunk is associated with a transform node, whose matrix should be multiplied by
31 its ancestor transform nodes in order to compute the final transformation matrix 31 its ancestor transform nodes in order to compute the final transformation matrix
32 to the screen. 32 to the screen.
33 33
34 *** note 34 Paint properties are owned and stored by the object that creates them (see
35 Support for all paint properties has yet to be implemented in SPv2. 35 [ObjectPaintProperties](../../../core/paint/ObjectPaintProperties.h) and the
36 *** 36 paint properties on [FrameView](../../../core/frame/FrameView.h)). The complete
37 set of property tree nodes used to paint a LayoutObject is cached on
38 [ObjectPaintProperties](../../../core/paint/ObjectPaintProperties.h) in
39 `LocalBorderBoxProperties`. There is an important distinction between the local
40 border box properties and the properties owned by a layout object: a null
41 property in [ObjectPaintProperties](../../../core/paint/ObjectPaintProperties.h)
42 (e.g., `paintOffsetTranslation`) only implies that a specific LayoutObject
43 doesn't create a property, but a null value in `LocalBorderBoxProperties`
44 implies that the root property tree node should be used.
37 45
38 *** aside 46 *** aside
39 TODO(jbroman): Explain the semantics of transforms, clips, scrolls and effects 47 TODO(jbroman): Explain the semantics of transforms, clips, scrolls and effects
40 as support for them is added to SPv2. 48 as support for them is added to SPv2.
41 *** 49 ***
42 50
43 ### Transforms 51 ### Transforms
44 52
45 Each paint chunk is associated with a [transform node](TransformPaintPropertyNod e.h), 53 Paint chunks can be associated with a [transform node](TransformPaintPropertyNod e.h)
46 which defines the coordinate space in which the content should be painted. 54 which defines the coordinate space in which the content should be painted.
47 55
48 Each transform node has: 56 Each transform node has:
49 57
50 * a 4x4 [`TransformationMatrix`](../../transforms/TransformationMatrix.h) 58 * a 4x4 [`TransformationMatrix`](../../transforms/TransformationMatrix.h)
51 * a 3-dimensional transform origin, which defines the origin relative to which 59 * 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 60 the transformation matrix should be applied (e.g. a rotation applied with some
53 transform origin will rotate the plane about that point) 61 transform origin will rotate the plane about that point)
54 * a pointer to the parent node, which defines the coordinate space relative to 62 * a pointer to the parent node, which defines the coordinate space relative to
55 which the above should be interpreted 63 which the above should be interpreted
(...skipping 17 matching lines...) Expand all
73 *** 81 ***
74 82
75 Note that, even though CSS does not permit it in the DOM, the transform tree can 83 Note that, even though CSS does not permit it in the DOM, the transform tree can
76 have nodes whose children do not flatten their inherited transform and 84 have nodes whose children do not flatten their inherited transform and
77 participate in no 3D rendering context. For example, not flattening is necessary 85 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 86 to preserve the 3D character of the perspective transform, but this does not
79 imply any 3D sorting. 87 imply any 3D sorting.
80 88
81 ### Clips 89 ### Clips
82 90
83 Each paint chunk is associated with a [clip node](ClipPaintPropertyNode.h), 91 Paint chunks can be associated with a [clip node](ClipPaintPropertyNode.h)
84 which defines the raster region that will be applied on the canvas when 92 which defines the raster region that will be applied on the canvas when
85 the chunk is rastered. 93 the chunk is rastered.
86 94
87 Each clip node has: 95 Each clip node has:
88 96
89 * A float rect with (optionally) rounded corner radius. 97 * A float rect with (optionally) rounded corner radius.
90 * An associated transform node, which the clip rect is based on. 98 * An associated transform node, which the clip rect is based on.
91 99
92 The raster region defined by a node is the rounded rect transformed to the 100 The raster region defined by a node is the rounded rect transformed to the
93 root space, intersects with the raster region defined by its parent clip node 101 root space, intersects with the raster region defined by its parent clip node
94 (if not root). 102 (if not root).
95 103
96 ### Scrolling 104 ### Scrolling
97 105
98 Each paint chunk is associated with a [scroll node](ScrollPaintPropertyNode.h) 106 Paint chunks can be associated with a [scroll node](ScrollPaintPropertyNode.h)
99 which defines information about how a subtree scrolls so threads other than the 107 which defines information about how a subtree scrolls so threads other than the
100 main thread can perform scrolling. Scroll information includes: 108 main thread can perform scrolling. Scroll information includes:
101 109
102 * Which directions, if any, are scrollable by the user. 110 * Which directions, if any, are scrollable by the user.
103 * A reference to a [transform node](TransformPaintPropertyNode.h) which contains 111 * A reference to a [transform node](TransformPaintPropertyNode.h) which contains
104 a 2d scroll offset. 112 a 2d scroll offset.
105 * The extent that can be scrolled. For example, an overflow clip of size 7x9 113 * The extent that can be scrolled. For example, an overflow clip of size 7x9
106 with scrolling contents of size 7x13 can scroll 4px vertically and none 114 with scrolling contents of size 7x13 can scroll 4px vertically and none
107 horizontally. 115 horizontally.
108 116
109 To ensure geometry operations are simple and only deal with transforms, the 117 To ensure geometry operations are simple and only deal with transforms, the
110 scroll offset is stored as a 2d transform in the transform tree. 118 scroll offset is stored as a 2d transform in the transform tree.
111 119
112 ### Effects 120 ### Effects
113 121
114 Each paint chunk is associated with an [effect node](EffectPaintPropertyNode.h), 122 Paint chunks can be associated with an [effect node](EffectPaintPropertyNode.h)
115 which defines the effect (opacity, transfer mode, filter, mask, etc.) that 123 which defines the effect (opacity, transfer mode, filter, mask, etc.) that
116 should be applied to the content before or as it is composited into the content 124 should be applied to the content before or as it is composited into the content
117 below. 125 below.
118 126
119 Each effect node has: 127 Each effect node has:
120 128
121 * a floating-point opacity (from 0 to 1, inclusive) 129 * a floating-point opacity (from 0 to 1, inclusive)
122 * a pointer to the parent node, which will be applied to the result of this 130 * a pointer to the parent node, which will be applied to the result of this
123 effect before or as it is composited into its parent in the effect tree 131 effect before or as it is composited into its parent in the effect tree
124 132
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 visual and transformed rects of display items in the coordinate space of ancesto r 273 visual and transformed rects of display items in the coordinate space of ancesto r
266 [`GeometryPropertyTreeState`](GeometryPropertyTreeState.h)s. 274 [`GeometryPropertyTreeState`](GeometryPropertyTreeState.h)s.
267 275
268 The transformed rect of a display item in an ancestor `GeometryPropertyTreeState ` 276 The transformed rect of a display item in an ancestor `GeometryPropertyTreeState `
269 is that rect, multiplied by the transforms between the display item's 277 is that rect, multiplied by the transforms between the display item's
270 `GeometryPropertyTreeState` and the ancestors, then flattened into 2D. 278 `GeometryPropertyTreeState` and the ancestors, then flattened into 2D.
271 279
272 The visual rect of a display item in an ancestor `GeometryPropertyTreeState` is 280 The visual rect of a display item in an ancestor `GeometryPropertyTreeState` is
273 the intersection of all of the intermediate clips (transformed in to the 281 the intersection of all of the intermediate clips (transformed in to the
274 ancestor state), with the display item's transformed rect. 282 ancestor state), with the display item's transformed rect.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698