| 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 Overview |
| 11 ---------- | 11 -------- |
| 12 |
| 13 ### Base Model |
| 12 | 14 |
| 13 The base class for every node in the render tree is | 15 The base class for every node in the render tree is |
| 14 [`RenderObject`](object.dart), which defines the base layout model. The base | 16 [`RenderObject`](object.dart), which defines the base layout model. The base |
| 15 layout mode is extremely general and can accomodate a large number of more | 17 layout mode is extremely general and can accomodate a large number of more |
| 16 concrete layout models that can co-exist in the same tree. For example, the base | 18 concrete layout models that can co-exist in the same tree. For example, the base |
| 17 model does not commit to a fixed number of dimensions or even a cartesian | 19 model does not commit to a fixed number of dimensions or even a cartesian |
| 18 coordinate system. In this way, a single render tree can contain render objects | 20 coordinate system. In this way, a single render tree can contain render objects |
| 19 operating in three-dimensional space together with other render objects | 21 operating in three-dimensional space together with other render objects |
| 20 operating in two-dimensional space, e.g., on the face of a cube in the three- | 22 operating in two-dimensional space, e.g., on the face of a cube in the three- |
| 21 dimensional space. Moreover, the two-dimensional layout might be partially | 23 dimensional space. Moreover, the two-dimensional layout might be partially |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 68 |
| 67 * `RenderObjectWithChildMixin` is useful for subclasses of `RenderObject` that | 69 * `RenderObjectWithChildMixin` is useful for subclasses of `RenderObject` that |
| 68 have a unique child. | 70 have a unique child. |
| 69 | 71 |
| 70 * `ContainerRenderObjectMixin` is useful for subclasses of `RenderObject` that | 72 * `ContainerRenderObjectMixin` is useful for subclasses of `RenderObject` that |
| 71 have a child list. | 73 have a child list. |
| 72 | 74 |
| 73 Subclasses of `RenderObject` are not required to use either of these child | 75 Subclasses of `RenderObject` are not required to use either of these child |
| 74 models and are free to invent novel child models for their specific use cases. | 76 models and are free to invent novel child models for their specific use cases. |
| 75 | 77 |
| 76 Parent Data | 78 ### Parent Data |
| 77 ----------- | 79 |
| 80 ### Box Model |
| 81 |
| 82 #### EdgeDims |
| 83 |
| 84 #### BoxConstraints |
| 85 |
| 86 ### Bespoke Models |
| 78 | 87 |
| 79 | 88 |
| 80 Box Model | 89 Using the provided subclasses |
| 81 --------- | 90 ----------------------------- |
| 91 |
| 92 ### render_box.dart |
| 93 #### RenderConstrainedBox |
| 94 #### RenderShrinkWrapWidth |
| 95 #### RenderOpacity |
| 96 #### RenderColorFilter |
| 97 #### RenderClipRect |
| 98 #### RenderClipOval |
| 99 #### RenderPadding |
| 100 #### RenderPositionedBox |
| 101 #### RenderImage |
| 102 #### RenderDecoratedBox |
| 103 #### RenderTransform |
| 104 #### RenderSizeObserver |
| 105 #### RenderCustomPaint |
| 106 ### RenderBlock (render_block.dart) |
| 107 ### RenderFlex (render_flex.dart) |
| 108 ### RenderParagraph (render_paragraph.dart) |
| 109 ### RenderStack (render_stack.dart) |
| 110 |
| 111 Writing new subclasses |
| 112 ---------------------- |
| 113 |
| 114 ### The RenderObject contract |
| 115 |
| 116 #### The ParentData contract |
| 117 |
| 118 #### Using RenderObjectWithChildMixin |
| 119 |
| 120 #### Using ContainerParentDataMixin and ContainerRenderObjectMixin |
| 121 |
| 122 ### The RenderBox contract |
| 123 |
| 124 #### Using RenderProxyBox |
| 125 |
| 126 ### The Hit Testing contract |
| 82 | 127 |
| 83 | 128 |
| 84 Bespoke Models | 129 Performance rules of thumb |
| 85 -------------- | 130 -------------------------- |
| 131 |
| 132 * Avoid using transforms where mere maths would be sufficient (e.g. |
| 133 draw your rectangle at x,y rather than translating by x,y and |
| 134 drawing it at 0,0). |
| 135 |
| 136 * Avoid using save/restore on canvases. |
| 86 | 137 |
| 87 | 138 |
| 88 Dependencies | 139 Dependencies |
| 89 ------------ | 140 ------------ |
| 90 | 141 |
| 91 * [`package:sky/base`](../base) | 142 * [`package:sky/base`](../base) |
| 92 * [`package:sky/mojo`](../mojo) | 143 * [`package:sky/mojo`](../mojo) |
| 93 * [`package:sky/animation`](../mojo) | 144 * [`package:sky/animation`](../mojo) |
| OLD | NEW |