[framework] allow other RenderObjects to behave like repaint boundaries#101952
[framework] allow other RenderObjects to behave like repaint boundaries#101952fluttergithubbot merged 32 commits intoflutter:masterfrom
Conversation
|
The latest change allows opacity layers to mark that only their opacity has changed, which allows us to skip rebuilding the child layer. This is required to make the animated switch picture stable without a repaint boundary |
|
@goderbauer it ended up being harder to make I added a markNeedsX which - if the node is not also marked as needing to be painted - will avoid recreating chiild layers and just update the layer properties |
|
i'm marking this ready for review, though I'm aware the tests and documentation need to be improved substantially first. |
|
Also: in order for something like RenderTransform to opt into this we'd need to support swapping out the kind of layer while keeping the children. |
| const Rect.fromLTWH(0, 0, 500, 500), | ||
| ); | ||
| root.paint(context, const Offset(40, 40)); | ||
| context.paintChild(root, const Offset(40, 40)); |
There was a problem hiding this comment.
minor change: since the RenderOpacity would be a repaint boudary in this case, it would have gone down context.paintChild path to get to compositing correctly
|
I've added more extensive documentation in #101941 describing the change |
This PR has the goal of allowing render objects which maintain their own composited layer to opt into being repaint boundaries. This requires that the layer be created and managed by the framework and that the layer is an Offset layer subtype. We also add the capability for a repaint boundary to update only its layer properties without repainting its children. This allows the Opacity layers to update or animate their opacity without recreating child pictures, stabilizing the tree without user intervention.
Fixes #101941
Fixes #101597