-
Notifications
You must be signed in to change notification settings - Fork 6k
[canvaskit] Improve how overlays are optimized #54547
[canvaskit] Improve how overlays are optimized #54547
Conversation
| /// | ||
| /// [paramsForViews] is required to compute the bounds of the platform views. | ||
| // TODO(harryterkelsen): Extend this to work for any sequence of platform views | ||
| // and pictures. |
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.
Link to flutter/flutter#149863?
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.
Done.
| // it intersects with is "P_0", so we create a new render canvas and add "P_0" | ||
| // to it. | ||
| // The first picture is added to the rendering in a new render canvas. | ||
| RenderingRenderCanvas tentativeCanvas = RenderingRenderCanvas(); |
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.
Can't quite parse all the possible situations when the loop below can exit. Is there a chance of the initial tentativeCanvas to never be used? If so, do we need to dispose of any resources it might be holding onto?
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.
It's possible for the tentativeCanvas to never be used. A RenderingRenderCanvas doesn't have any resources that need to be cleaned up until they are actually used and assigned a real RenderCanvas to paint their pictures to. Before that, they are basically just a list of pictures.
…153529) flutter/engine@8f3f80e...65fd6ca 2024-08-15 [email protected] [canvaskit] Improve how overlays are optimized (flutter/engine#54547) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#153529) flutter/engine@8f3f80e...65fd6ca 2024-08-15 [email protected] [canvaskit] Improve how overlays are optimized (flutter/engine#54547) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#153529) flutter/engine@8f3f80e...65fd6ca 2024-08-15 [email protected] [canvaskit] Improve how overlays are optimized (flutter/engine#54547) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Enhances the overlay optimization by pushing new pictures to the earliest RenderCanvas they can go into. This improvement is made especially clear in the new test case I added to
embedded_views_test.dart, with the previous algorithm we would have used an overlay for each platform view even though all of the pictures could go into the base canvas with no issue.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.