Skip to content

Embedder uses too many surfaces for platform views #129710

@knopp

Description

@knopp

Here is example application that has 4 platform views interleaved with Flutter content:

Screenshot 2023-06-28 at 14 22 26

It uses a total of 5 surfaces, each one has size of entire window (because resizing surfaces is expensive). However there is no content directly painted over platform view so this entire scene could be rendered to the background surface and the end result would be same, saving 4 surfaces.

Another example - 4 platform views with Flutter content painted above the views:

Screenshot 2023-06-28 at 14 21 51

This still uses 5 surfaces, but the same visual result can be represented by only two surfaces - content that is painted below platform views in first surface and content that is painted above platform views in second surface.

Same scene, painted with https://flutter.dev/go/optimized-platform-view-layers:

optimized-platform-view-layers.mov

Initially, there are two surface, but as they move to not paint over platform views, only one surface remains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopa: platform-viewsEmbedding Android/iOS views in Flutter appsc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.fyi-linuxFor the attention of the Linux platform teamfyi-macosFor the attention of macOS platform teamfyi-windowsFor the attention of the Windows platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions