Skip to content
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

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Mar 19, 2024

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C , Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

auto-submit bot pushed a commit that referenced this pull request Mar 22, 2024
_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
lib/ui/window/platform_configuration.h Outdated Show resolved Hide resolved
runtime/runtime_controller.h Outdated Show resolved Hide resolved
lib/ui/window/platform_configuration.h Outdated Show resolved Hide resolved
runtime/runtime_controller.cc Outdated Show resolved Hide resolved
runtime/runtime_controller.cc Outdated Show resolved Hide resolved
runtime/runtime_controller.h Outdated Show resolved Hide resolved
runtime/runtime_controller.h Outdated Show resolved Hide resolved
@dkwingsmt
Copy link
Contributor

Ooops sorry I forgot to submit my reviews. Here they are. Feel free to change them in the official PRs.

@loic-sharma loic-sharma marked this pull request as ready for review March 29, 2024 17:03
Copy link
Contributor

@dkwingsmt dkwingsmt left a 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;
Copy link
Member

@cbracken cbracken Apr 2, 2024

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);
Copy link
Member

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.

Copy link
Member Author

@loic-sharma loic-sharma Apr 2, 2024

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.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with just a few small nits.

LGTM stamp from a Japanese personal seal

Copy link
Member

@cbracken cbracken left a 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!

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 2, 2024
@auto-submit auto-submit bot merged commit d437810 into flutter:main Apr 2, 2024
26 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 2, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 2, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-fuchsia
Projects
None yet
3 participants