[WIP] Allow running macOS embedder with UI and platform thread merged#53747
[WIP] Allow running macOS embedder with UI and platform thread merged#53747knopp wants to merge 1 commit intoflutter:mainfrom
Conversation
Remaining issues to solve:
The microtask queue is currently being flushed though a Instead, we should post the message directly the task runner provided by the embedder, and possibly flush the microtask queue after each task internally. |
ba7d8dc to
df02653
Compare
df02653 to
d7cf0e8
Compare
d7cf0e8 to
57a040c
Compare
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. |
|
Since this is blocked on the linked issue, can we close this till support for that API is added? |
Original issue: flutter/flutter#150525
This is a work in progress PR for letting the macOS embedder run both with and without UI and platform thread merged.
Changes in the resize / vsync synchronization:
FlutterRunLoopclass to schedule tasks Flutter tasks on main thread in a way where it is possible to only process these tasks while waiting for correct frame size during resizing. This significantly simplifies the resize synchronization and makes the same code work both with separate UI thread and with UI and platform thread merged.FlutterThreadSynchronizerhas been renamed toFlutterResizeSynchronizervastly simplified, mutex and conditions are removed and the blocking is now done by only processing Flutter messages while waiting for resizing. It is now per view (instead of storing a viewId->Size map internally) and owned by the view itself, instead of engine.Regarding resize synchronization this approach should work for Windows and Linux embedders as well. On both platforms we manage the task queue internally and are able to only process only Flutter messages so that we can block the platform thread while we keep the UI task runner going.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.