This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[skwasm] Fixes for getting pixels from an image. #53561
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There were two issues here: 1) We have to stop using the emscripten thread scheduling APIs, as they can be invoked out of order from the rest of the messages that are posted. In some cases, out of order message handling can cause the request for reading pixels in an image to be serviced before some of the texture sources have been transfered to the web worker. 2) Skia's `readPixels` fails if there is is a lazy picture image made from a picture that contains a lazy texture image. The pertinent bug is here: https://g-issues.skia.org/issues/349201915 To work around the Skia bug, we just render the image itself onto our scratch canvas and pull the pixels out with `glReadPixels`. This fixes flutter/flutter#141326
yjbanov
approved these changes
Jun 25, 2024
Contributor
yjbanov
left a comment
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.
| } | ||
|
|
||
| // Main thread only | ||
| // Worker thread only |
Contributor
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.
Important distinction! :)
Contributor
Author
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.
The semantics here actually changed as part of this PR. dispose used to be called on the main thread, and then that dispatched to the web worker which called _dispose. Now there's just one method, dispose and that does what _dispose used to do.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 25, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 25, 2024
…150797) flutter/engine@62e0b5f...94023d7 2024-06-25 [email protected] [skwasm] Fixes for getting pixels from an image. (flutter/engine#53561) 2024-06-25 [email protected] fix: web canvaskit fragment shaders were not using updated uniform values (flutter/engine#53246) 2024-06-25 [email protected] Roll Dart SDK from b5fc85cfcf1b to 65ab2f2cf0d3 (1 revision) (flutter/engine#53565) 2024-06-25 [email protected] Roll Skia from e4e4feb97a54 to da1ea4eb0270 (4 revisions) (flutter/engine#53563) 2024-06-25 [email protected] [DisplayList] Switch to recording DrawVertices objects by reference (flutter/engine#53548) 2024-06-25 [email protected] Roll Skia from 5f21260470cf to e4e4feb97a54 (1 revision) (flutter/engine#53559) 2024-06-25 [email protected] [impeller] Cleanup blur (flutter/engine#53543) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
platform-web
Code specifically for the web engine
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There were two issues here:
We have to stop using the emscripten thread scheduling APIs, as they can be invoked out of order from the rest of the messages that are posted. In some cases, out of order message handling can cause the request for reading pixels in an image to be serviced before some of the texture sources have been transfered to the web worker.
Skia's
readPixelsfails if there is is a lazy picture image made from a picture that contains a lazy texture image. The pertinent bug is here: https://g-issues.skia.org/issues/349201915To work around the Skia bug, we just render the image itself onto our scratch canvas and pull the pixels out with
glReadPixels.This fixes flutter/flutter#141326