Sitelet https://github.com/flutter/flutter/issues/112232
Skip to content

[iOS] Migrate to embedder API #112232

Description

@cyanglaz

Migrate iOS embedder to use the embedder API

The current planned steps are: (Check marked items are in flutter/main)

  • Setup a runtime flag to enable and disable Embedder api during the migration.
  • ☂️ Migrate iOS embedder objective-c code to ARC (Auto Reference Counting) #137801
  • Initialize the FlutterEngineProcTable& embedderAPI property, with callbacks left as TODOs.
  • Implementing features. This can be separated to smaller patches, enable tests along the way if possible
  • Run all the tests with the embedder API, make sure there are no meaningless regressions.
  • Remove legacy code and make embedder API stable.

In step 3 above, some features are non-trivial. They are listed are listed below: (Check marked items are in flutter/main)

  • Initialize FlutterEngine with EmbedderAPI.
  • Render content on FlutterView.
  • Background Platform Channel message
  • Touch events.
  • Keyboard Events.
  • External View Embedder (PlatformView)
  • SemanticsUpdate
  • VsyncWaiter

Additional graphics-related work

  • Impeller integration
  • Swapchain integration
  • Wide gamut
  • Hook up graphics debugger

A draft PR that contains the full migration is maintained here: flutter-team-archive/engine#39988 as a reference while working on individual patches.

Below is a list of completed features in the draft PR. (Check marked items are the ones completed in the flutter-team-archive/engine#39988)

  • Initialize FlutterEngine with EmbedderAPI.
  • Render content on FlutterView.
  • Background Platform Channel message. (Workaround)
  • Background Platform Channel message.
  • Touch events.
  • Keyboard Events.
  • External View Embedder (PlatformView) (In progress)
  • SemanticsUpdate
  • VsyncWaiter

Currently, the embedder API doesn't support impeller. #112230 is required to enable iOS to use impeller by default after the migration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work liste: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions