Skip to content

Picture.toImage must return a GPU resident image. #13498

@chinmaygarde

Description

@chinmaygarde

Currently, the synchronous call to materialize the image from a picture obtained from a picture recorder returns an image whose data is resident on the host. This is the only way it can work right now because the UI task runner does not have access to the GPU context. While such images work well for callers that attempt to manipulate the bytes of the image, rendering multiple frames with such images causes a per frame texture upload. This kills performance. Images obtained via an IO thread hop perform the texture upload and get rid of the host side allocation before returning a reference to the GPU image to the Dart wrapper of the image. Hence, such images are fast to render to per frame.

We should make the call to Picture.toImage return a future to the image so that we can perform the same thread hop and return a handle to a GPU resident image.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions