Skip to content

Remove single window assumption from SceneBuilder #112202

@goderbauer

Description

@goderbauer

The Scene created by the SceneBuilder has a single window assumption backed in:

https://github.com/flutter/engine/blob/9a830e011cb92565b55aac3d1e03ee1c1da835f6/lib/ui/compositing/scene.cc#L40-L44

In the code above it grabs the first window and reads the physical size and device pixel ratio of it. In the multi window world, we will need to create Scenes for multiple different windows, so that assumption has to go.

Ideas:

  1. The physical size and device pixel ratio are injected into the Scene when it is rendered into a specific FlutterView by passing it to FlutterView.render. At that point, it is clear to what FlutterView the scene belongs and the values can be read of that view.
  2. The SceneBuilder provides an option to configure the physical size and the dpr for the Scene (either by providing setters or by taking these values as arguments to SceneBuilder.build).

If we go down route 2, we should make these parameters optional first and default them to the values read from the first window. Then, once the framework has been migrated to set these parameters based on the view the scene is gonna be rendered into, the parameters should become required and the single window assumption is removed from the Scene.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: multi windowIssues related to multi window supportc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions