engine icon indicating copy to clipboard operation
engine copied to clipboard

[Impeller] Allow setting the contents of a Texture subregion.

Open jonahwilliams opened this issue 1 year ago • 3 comments

Introduce IRect region an new argument to Texture::SetContents that allows a subregion of the image to be updated. I plan to use this to improve the performance of the glyph atlas: Rather than keeping a full software bitmap in memory, we can write updates directly into a device buffer and incrementally update the glyph atlas texture.

This will be necessary to fix https://github.com/flutter/flutter/issues/138798 which demonstrates that the current strategy is less then optimal.

Previously when I attempted to write updates directlty to a device buffer, I failed to note the synchronization requirements. However, if we no longer keep the CPU bitmap / device buffer resident then this is no longer an issue.

jonahwilliams avatar Feb 19 '24 23:02 jonahwilliams

@gaaclarke is there a way I can golden results from the entity unittests? Happy to do the work if it needs to be wired up.

jonahwilliams avatar Feb 23 '24 22:02 jonahwilliams

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #50768 at sha f47f536fdf8b291f90e023a96b62fb7e204525d7

flutter-dashboard[bot] avatar Feb 29 '24 01:02 flutter-dashboard[bot]

I've wired this up with gold and confirmed that the usage of the API is correct on GLES, except for Texture Cube, which I need to fix separately.

jonahwilliams avatar Feb 29 '24 01:02 jonahwilliams

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

flutter-dashboard[bot] avatar Mar 27 '24 21:03 flutter-dashboard[bot]

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

flutter-dashboard[bot] avatar Mar 27 '24 21:03 flutter-dashboard[bot]

I don't have time to work on this right now

jonahwilliams avatar Apr 15 '24 20:04 jonahwilliams