-
Notifications
You must be signed in to change notification settings - Fork 6k
Use MakeWebGLSurface in toImageSync
#35276
Use MakeWebGLSurface in toImageSync
#35276
Conversation
| final ByteData? data = await image.toByteData(); | ||
| expect(data, isNotNull); | ||
| expect(data!.lengthInBytes, 10 * 15 * 4); | ||
| expect(data.buffer.asUint32List().any((int byte) => byte != 0), isTrue); |
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.
Bonus points if this is also a golden test
|
Gold has detected about 1 new digest(s) on patchset 7. |
|
Gold has detected about 1 new digest(s) on patchset 9. |
|
Gold has detected about 1 new digest(s) on patchset 11. |
|
Gold has detected about 1 new digest(s) on patchset 13. |
|
Gold has detected about 1 new digest(s) on patchset 14. |
|
Gold has detected about 1 new digest(s) on patchset 15. |
|
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. |
|
Gold has detected about 1 new digest(s) on patchset 16. |
|
Golden file changes are available for triage from new commit, Click here to view. |
|
Gold has detected about 1 new digest(s) on patchset 17. |
|
I'm not sure the entire context for this fix, but note that this is a large performance regression in cases where it is not needed. In general, reading back from the GPU is a high latency operation and should be avoided at all costs |
| width: width, | ||
| height: height, | ||
| ); | ||
| final Uint8List pixels = skImage.readPixels(0, 0, imageInfo); |
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.
Specifically this part
Uses a WebGL surface in conjunction with
readPixelsto make an image from anSkPicture. This is needed since the picture may contain GL texture-backed images.Fixes flutter/flutter#103803
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.