Skip to content

[macOS] Implement unobstructed platform views #129073

@knopp

Description

@knopp

Right now every presented layer is displayed by a CALayer of identical size. This has several issues:

  • Content of most of overlay layers is usually empty. This means potentially a lot of unnecessary work by system compositor where it needs to blend entire surface.
  • Platform views being obstructed by Flutter overlay CALayer. Admittedly this is less of a problem on desktop but on mobile this would cause problems with Google Ad views for example. Eventually if the iOS embedder gets migrated to embedder API Google Ad views should just work.

The embedder already tracks painted areas - these needs to be passed though the embedder API so that the embedder can build CALayers showing just the visible part of backing surface.

The PR will also add a FLTEnableSurfaceDebugInfo flag for Info.plist that will show the boundaries of each layer and display the layer count:

surface-debug.mov

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: desktopRunning on desktopa: platform-viewsEmbedding Android/iOS views in Flutter appsengineflutter/engine related. See also e: labels.platform-macBuilding on or for macOS specificallyteam-macosOwned by the macOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions