-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
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.