You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After finishing our first milestone of retained rendering (#21756), let's explore what more we can achieve with retained rendering. Here are some examples:
Explore if we can add an option to RepaintBoundary and improve performance significantly by using snapshot of a layer subtree that's not a child of an OpacityLayer. See Add RasterCache option to RepaintBoundary widget #32662.
@liyuqian Can you elaborate on "Explore if we can add an option to RepaintBoundary and improve performance significantly by using snapshot of a layer subtree that's not a child of an OpacityLayer"?
@Hixie : I was thinking about raster caching the whole layer subtree for either a TransformLayer (#24627), or an ImageFiltered layer. See #32662 for more details. @flar has been doing a lot of work recently (including introducing the new ImageFiltered layer flutter-team-archive/engine#14491). So @flar may be able to provide more details.
ImageFiltered does cache if its child layer is stable, but it is only stable if you use a RepaintBoundary.
Right now we recreate a lot of layers even if nothing changes. I'm still digging into our strategies there, but a lot of it probably hinges on the way that we manage Picture layers. They are recreated if the part of the tree they are in is visited even if they themselves don't involve any Widgets/RenderObjects that changed.
They are also created from groups of RenderObjects that are next to each other in a depth-first traversal of the tree, but that don't necessarily all descend from a single parent. If the picture was generated from a single RenderObject then we might be able to just check a flag on that object, but pictures are actually generated from a group of them and since they aren't aware that they are all contributing to the same picture together, we end up with no specific flag that can be checked to see if the picture is dirty and so we pessimistically recreate it every time we traverse the tree.
I have a change pending that can try to make a better determination if a picture is actually changing, but it is more reactive than I'd like and it doesn't have as much impact as I'd like to see. I'm still investigating its potential and thinking of alternate solutions. A preliminary version of it can be seen in a branch on my fork of the framework repo in this commit: flar@bc131bf
If we can get our layers to be reused more then it becomes a lot more feasible to cache layer renderings in the engine with a few lines of code in the engine layers and potentially without requiring developers to use RepaintBoundary all the time.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Retained rendering in Fuchsia PhysicalShapeLayer (#6558)
Hixie commentedon Jan 9, 2020
@liyuqian Can you elaborate on "Explore if we can add an option to
RepaintBoundaryand improve performance significantly by using snapshot of a layer subtree that's not a child of anOpacityLayer"?liyuqian commentedon Jan 10, 2020
@Hixie : I was thinking about raster caching the whole layer subtree for either a
TransformLayer(#24627), or anImageFilteredlayer. See #32662 for more details. @flar has been doing a lot of work recently (including introducing the newImageFilteredlayer flutter-team-archive/engine#14491). So @flar may be able to provide more details.flar commentedon Jan 10, 2020
ImageFiltered does cache if its child layer is stable, but it is only stable if you use a RepaintBoundary.
Right now we recreate a lot of layers even if nothing changes. I'm still digging into our strategies there, but a lot of it probably hinges on the way that we manage Picture layers. They are recreated if the part of the tree they are in is visited even if they themselves don't involve any Widgets/RenderObjects that changed.
They are also created from groups of RenderObjects that are next to each other in a depth-first traversal of the tree, but that don't necessarily all descend from a single parent. If the picture was generated from a single RenderObject then we might be able to just check a flag on that object, but pictures are actually generated from a group of them and since they aren't aware that they are all contributing to the same picture together, we end up with no specific flag that can be checked to see if the picture is dirty and so we pessimistically recreate it every time we traverse the tree.
I have a change pending that can try to make a better determination if a picture is actually changing, but it is more reactive than I'd like and it doesn't have as much impact as I'd like to see. I'm still investigating its potential and thinking of alternate solutions. A preliminary version of it can be seen in a branch on my fork of the framework repo in this commit: flar@bc131bf
If we can get our layers to be reused more then it becomes a lot more feasible to cache layer renderings in the engine with a few lines of code in the engine layers and potentially without requiring developers to use RepaintBoundary all the time.
jonahwilliams commentedon Aug 13, 2024
Impeller is moving away from full scene or layer based caching. Closing as obsolete.
github-actions commentedon Aug 27, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.