-
Notifications
You must be signed in to change notification settings - Fork 6k
SceneBuilder.addPicture returns the layer #26074
Conversation
yjbanov
left a comment
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.
|
|
||
| abstract class PhysicalShapeEngineLayer implements EngineLayer {} | ||
|
|
||
| abstract class PictureEngineLayer implements EngineLayer {} |
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 you please leave a TODO(yjbanov) here and a Github issue for me to incorporate this into our DOM diffing algorithm?
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
| Picture picture, { | ||
| bool isComplexHint = false, | ||
| bool willChangeHint = false, | ||
| PictureEngineLayer? oldLayer, |
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.
Docs for the new argument? I think the dart.ui.sceneBuilder.oldLayer macro should be reusable here. There's also the dart.ui.sceneBuilder.oldLayerVsRetained macro but I'm not sure it applies to pictures. Picture layer is a leaf layer and the same picture can be reused multiple time in the same scene.
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
|
This will have some minor conflicts with #25234 depending on which goes in first. "Pictures" will no longer always be a Skia-oriented thing. |
That's why I'm copying you for review :) |

Today,
SceneBuilder.addPicturecreates an engine side layer but does not return a handle to that layer.As part of flutter/flutter#81514, we'll want to be able to tell these layers when we are done with them framework side so the picture can get disposed of properly - otherwise, even if the framework tries to dispose its copy of the
Pictureobject, picture layers will still retain it until they are disposed, which will require a full GC. This will help both VM and web. This PR does not add the dispose method, but instead just makes the smaller change to return the layer for now.I did all the checkbox things.