Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[macOS] Add platformview creation parameter support #42607

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Jun 7, 2023

Previously, when creating native platform views on macOS, we ignored any parameters passed via the framework side "params" argument in the "create" method call, and instead always passed a nil value to the FlutterPlatformViewFactory. This made it impossible for users of macOS platform views to pass constructor arguments to the NSView subclass implementing the platform view.

We now decode the arguments data using the codec specified by the FlutterPlatformViewFactory and pass them through to the [FlutterPlatformViewFactory createWithIdentifier:arguments:] method where the platform view author can make use of them.

Fixes: flutter/flutter#124723

This is a part of the broader macOS platform view support effort: flutter/flutter#41722

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 Hixie said 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.

@cbracken cbracken changed the title [macOS] Add platformview create parameter support [macOS] Add platformview creation parameter support Jun 7, 2023
@cbracken cbracken force-pushed the ctor-params branch 3 times, most recently from ca854ec to 09140c5 Compare June 7, 2023 01:52
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM!

cbracken added 2 commits June 7, 2023 09:55
Previously, when creating native platform views on macOS, we ignored any
parameters passed via the framework side "params" argument in the
"create" method call, and instead always passed a nil value to the
FlutterPlatformViewFactory. This made it impossible for users of macOS
platform views to pass constructor arguments to the NSView subclass
implementing the platform view.

We now decode the arguments data using the codec specified by the
`FlutterPlatformViewFactory` and pass them through to the
`[FlutterPlatformViewFactory createWithIdentifier:arguments:]` method
where the platform view author can make use of them.

Fixes: flutter/flutter#124723

This is a part of the broader macOS platform view support effort:
flutter/flutter#41722
@cbracken cbracken force-pushed the ctor-params branch 2 times, most recently from 10baeaa to 722c8fd Compare June 7, 2023 17:59
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM

@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 7, 2023

auto label is removed for flutter/engine, pr: 42607, due to - The status or check suite Windows windows_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
@auto-submit auto-submit bot merged commit 71c9d51 into flutter:main Jun 7, 2023
@cbracken cbracken deleted the ctor-params branch June 7, 2023 19:47
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 7, 2023
zanderso pushed a commit to flutter/flutter that referenced this pull request Jun 7, 2023
…128460)

flutter/engine@4f4486b...1089ce6

2023-06-07 jonahwilliams@google.com [Impeller] Add buffer to texture
blit for Vulkan. (flutter/engine#41706)
2023-06-07 chris@bracken.jp [macOS] Add platformview creation parameter
support (flutter/engine#42607)
2023-06-07 30870216+gaaclarke@users.noreply.github.com [Impeller] Added
a switch to turn on vulkan (flutter/engine#42585)
2023-06-07 skia-flutter-autoroll@skia.org Roll ANGLE from f8220fa3a729
to 15a29438b099 (1 revision) (flutter/engine#42627)
2023-06-07 jacksongardner@google.com Bump Chrome version to 114 for
testing (flutter/engine#42623)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from d607cbb0db78 to
773765ca1dd2 (7 revisions) (flutter/engine#42624)
2023-06-07 jpnurmi@gmail.com [Linux][a11y] implement
AtkText::get_text/string_at_offset() (flutter/engine#38144)
2023-06-07 skia-flutter-autoroll@skia.org Roll ANGLE from 176989ad00cc
to f8220fa3a729 (1 revision) (flutter/engine#42621)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from ee90e9ae2e62 to
d607cbb0db78 (1 revision) (flutter/engine#42618)
2023-06-07 skia-flutter-autoroll@skia.org Roll ANGLE from 1ad4ae4d63bf
to 176989ad00cc (1 revision) (flutter/engine#42617)
2023-06-07 dkwingsmt@users.noreply.github.com Revert "[Android] Return
keyboard pressed state" (flutter/engine#42616)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from bde894438f29 to
ee90e9ae2e62 (1 revision) (flutter/engine#42614)
2023-06-07 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from
lpbkSRJBMkPs0FM7_... to sEHtHM1iFt79roP-x... (flutter/engine#42613)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from cd3e1665dcd1 to
bde894438f29 (1 revision) (flutter/engine#42612)
2023-06-07 skia-flutter-autoroll@skia.org Roll ANGLE from 16841d6256da
to 1ad4ae4d63bf (1 revision) (flutter/engine#42611)
2023-06-07 bdero@google.com [Impeller] Reland 2: Add Impeller Metal
support in the embedder API (#42411) (flutter/engine#42597)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from a01f49f539ab to
cd3e1665dcd1 (1 revision) (flutter/engine#42610)
2023-06-07 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from
atrYtfHWi2cmV9B_C... to ojwVlxZWrbsG4WGSE... (flutter/engine#42609)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from 521b8c4bb011 to
a01f49f539ab (4 revisions) (flutter/engine#42608)
2023-06-07 skia-flutter-autoroll@skia.org Roll Skia from cef18d10b363 to
521b8c4bb011 (1 revision) (flutter/engine#42605)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from lpbkSRJBMkPs to sEHtHM1iFt79
  fuchsia/sdk/core/mac-amd64 from atrYtfHWi2cm to ojwVlxZWrbsG

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 jacksongardner@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass platform view arguments on macOS
3 participants