-
Notifications
You must be signed in to change notification settings - Fork 6k
[canvaskit] read pixels back in Picture.toImage #40004
Conversation
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.
Nit: this says its about toByteData, but the changes are in toImage.
Is there a way to defer the usage of MakeRasterDirectSurface until we're calling toByteData? ITs more or less expected that toByteData can be slow, but toImageSync is useful for composite effects using fragment shaders - and running those in software is not going to be feasible.
71fbadb
to
509eaf9
Compare
509eaf9
to
205b923
Compare
205b923
to
d679b87
Compare
Couldn't find a way to defer it. I'm going to start a thread with the Skia team to figure this out. In the meantime, I'm reverting #38573 and adding a new unit-test that catches the issue. Hopefully, next time we attempt it, it won't regress. |
For posterity, I tried the following solutions that didn't work:
|
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.
LGTM
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. |
This undoes the optimization made in #38573, and adds a test-case that would have failed when that optimization was made. The issue is that CanvasKit loses track of which resources belong to which context that leads to WebGL errors followed by UI corruption.
Fixes flutter/flutter#121758