This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[WIP] Allow running macOS embedder with UI and platform thread merged #53747
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.
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:
FlutterRunLoop
class 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.FlutterThreadSynchronizer
has been renamed toFlutterResizeSynchronizer
vastly 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.