You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ff0c16
Browse filesBrowse the repository at this point in the historyBrowse files
[web] Make resize and render atomic on the shared offscreen surface (flutter#194401)
Alternative to flutter#185622.
flutter#179473 split rendering on the
shared `OffscreenSurface` into two separately awaited steps: `setSize()`
and then `rasterizeToImageBitmaps()`. When multiple views render at the
same time, one view can resize the surface between another view's resize
and render, so that view ends up with a bitmap of the wrong size.
Skwasm's `Image.toByteData` uses the same surface and has the same
problem.
Instead of using a lock (like I did
[here](flutter#185622)), the size now
travels with each render, so the surface resizes and renders as one
indivisible operation:
- Skwasm: the size is part of the same message to the raster thread (as
it was before flutter#179473). Messages
are processed in order, so no locking is needed, and there is one less
worker round trip per view per frame.
- CanvasKit: resize, draw, and `createImageBitmap()` run synchronously.
Fixesflutter#185034
0 commit comments