OLD | NEW |
1 Sky Rendering | 1 Sky Rendering |
2 ============= | 2 ============= |
3 | 3 |
4 The Sky render tree is a low-level layout and painting system based on a | 4 The Sky render tree is a low-level layout and painting system based on a |
5 retained tree of objects that inherit from [`RenderObject`](object.dart). Most | 5 retained tree of objects that inherit from [`RenderObject`](object.dart). Most |
6 developers using Sky will not need to interact directly with the rendering tree. | 6 developers using Sky will not need to interact directly with the rendering tree. |
7 Instead, most developers should use [Sky widgets](../widgets/README.md), which | 7 Instead, most developers should use [Sky widgets](../widgets/README.md), which |
8 are built using the render tree. | 8 are built using the render tree. |
9 | 9 |
10 Base Model | 10 Base Model |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 * Implementations of `performLayout` are expected to call `layout` on their | 36 * Implementations of `performLayout` are expected to call `layout` on their |
37 children. When calling `layout`, a `RenderObject` must use the | 37 children. When calling `layout`, a `RenderObject` must use the |
38 `parentUsesSize` parameter to declare whether its `performLayout` function | 38 `parentUsesSize` parameter to declare whether its `performLayout` function |
39 depends on information read from the child. If the parent doesn't declare | 39 depends on information read from the child. If the parent doesn't declare |
40 that it uses the child's size, the edge from the parent to the child becomes | 40 that it uses the child's size, the edge from the parent to the child becomes |
41 a _relayout boundary_, which means the child (and its subtree) might undergo | 41 a _relayout boundary_, which means the child (and its subtree) might undergo |
42 layout without the parent undergoing layout. | 42 layout without the parent undergoing layout. |
43 | 43 |
44 * Subclasses of `RenderObject` must implement a `paint` function that draws a | 44 * Subclasses of `RenderObject` must implement a `paint` function that draws a |
45 visual representation of the object onto an `RenderObjectDisplayList`. If | 45 visual representation of the object onto a `RenderCanvas`. If |
46 the `RenderObject` has children, the `RenderObject` is responsible for | 46 the `RenderObject` has children, the `RenderObject` is responsible for |
47 painting its children using the `paintChild` function. | 47 painting its children using the `paintChild` function on the `RenderCanvas`. |
48 | 48 |
49 * Subclasses of `RenderObject` must call `adoptChild` whenever they add a | 49 * Subclasses of `RenderObject` must call `adoptChild` whenever they add a |
50 child. Similarly, they must call `dropChild` whenever they remove a child. | 50 child. Similarly, they must call `dropChild` whenever they remove a child. |
51 | 51 |
52 * Most subclasses of `RenderObject` will implement a `hitTest` function that | 52 * Most subclasses of `RenderObject` will implement a `hitTest` function that |
53 lets clients query the render tree for objects that intersect with a given | 53 lets clients query the render tree for objects that intersect with a given |
54 user input location. `RenderObject` itself does not impose a particular | 54 user input location. `RenderObject` itself does not impose a particular |
55 type signature on `hitTest`, but most implementations will take an argument | 55 type signature on `hitTest`, but most implementations will take an argument |
56 of type `HitTestResult` (or, more likely, a model-specific subclass of | 56 of type `HitTestResult` (or, more likely, a model-specific subclass of |
57 `HitTestResult`) as well as an object that describes the location at which | 57 `HitTestResult`) as well as an object that describes the location at which |
(...skipping 26 matching lines...) Expand all Loading... |
84 Bespoke Models | 84 Bespoke Models |
85 -------------- | 85 -------------- |
86 | 86 |
87 | 87 |
88 Dependencies | 88 Dependencies |
89 ------------ | 89 ------------ |
90 | 90 |
91 * [`package:sky/base`](../base) | 91 * [`package:sky/base`](../base) |
92 * [`package:sky/mojo`](../mojo) | 92 * [`package:sky/mojo`](../mojo) |
93 * [`package:sky/animation`](../mojo) | 93 * [`package:sky/animation`](../mojo) |
OLD | NEW |