-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Embedder API] Add view #51523
[Embedder API] Add view #51523
Conversation
_This is a refactoring with no semantic changes._ In a subsequent change, an `FlutterEngineAddView` embedder API will be introduced to add views. This API will need to create the view's initial engine viewport metrics, so this splits out the logic from `FlutterEngineSendWindowMetricsEvent` into a helper. Follow-up change that uses this new helper: #51523 Design doc: https://flutter.dev/go/multi-view-embedder-apis Prepares for: flutter/flutter#144806 [C , Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
81c5d1b
to
8ab4949
Compare
Ooops sorry I forgot to submit my reviews. Here they are. Feel free to change them in the official PRs. |
49f9d48
to
5069ec8
Compare
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.
LGTM, nice catch with the callbacks that are incompatible with multiple views. (Make sure to get approval from Chris or Chinmay)
FlutterEngineDisplayId display_id; | ||
/// The view that this event is describing. | ||
int64_t view_id; | ||
} FlutterWindowMetricsEvent; |
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.
Note to future archaeologists - this is just code moving around; there are no diffs here.
info.view_id = 123; | ||
info.view_metrics = &metrics; | ||
info.add_view_callback = [](const FlutterAddViewResult* result) { | ||
ASSERT_TRUE(result->added); |
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.
nit: Here and in a few places below -- given that this is just checking a result (rather than necessary for further checks below) should this be EXPECT_TRUE rather than ASSERT_TRUE? Agreed the two others should be asserts in this case.
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.
Ah good point. I did a pass through the tests and "downgraded" assertions that could be expectations.
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.
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.
l even more gtm!
…146159) flutter/engine@c60b00a...5dbcfdc 2024-04-02 [email protected] Do not use `adb shell screenrecord` during CI runs. (flutter/engine#51848) 2024-04-02 737941 [email protected] [Embedder API] Add view (flutter/engine#51523) 2024-04-02 [email protected] [skwasm] Fix `Paragraph.getLineBoundary` (flutter/engine#51846) 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
Adds
FlutterEngineAddView
to the embedder API. This will be used to add a view.Design doc: https://flutter.dev/go/multi-view-embedder-apis
Part of flutter/flutter#144806
Part of flutter/flutter#142845
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.