mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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 https://github.com/flutter/flutter/issues/141326