Remove single window assumption from SceneBuilder

This issue has been tracked since 2022-09-22.

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 the 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.

More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-09-30
Star Count 145381
Watcher Count 3565
Fork Count 23363
Issue Count 11208

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date