-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[framework] allow other RenderObjects to behave like repaint boundaries #101952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[framework] allow other RenderObjects to behave like repaint boundaries #101952
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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