Skip to content

Commit bb5d847

Browse files
committed
Revert "Revert "Migration to PlatformDispatcher and multi-window flutter#20496" (flutter#21792)"
This reverts commit c2938d0.
1 parent a82e917 commit bb5d847

File tree

72 files changed

+4381
-2517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4381
-2517
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ FILE: ../../../flutter/lib/ui/painting/single_frame_codec.h
371371
FILE: ../../../flutter/lib/ui/painting/vertices.cc
372372
FILE: ../../../flutter/lib/ui/painting/vertices.h
373373
FILE: ../../../flutter/lib/ui/painting/vertices_unittests.cc
374+
FILE: ../../../flutter/lib/ui/platform_dispatcher.dart
374375
FILE: ../../../flutter/lib/ui/plugins.dart
375376
FILE: ../../../flutter/lib/ui/plugins/callback_cache.cc
376377
FILE: ../../../flutter/lib/ui/plugins/callback_cache.h
@@ -500,6 +501,7 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/keyboard.dart
500501
FILE: ../../../flutter/lib/web_ui/lib/src/engine/mouse_cursor.dart
501502
FILE: ../../../flutter/lib/web_ui/lib/src/engine/onscreen_logging.dart
502503
FILE: ../../../flutter/lib/web_ui/lib/src/engine/picture.dart
504+
FILE: ../../../flutter/lib/web_ui/lib/src/engine/platform_dispatcher.dart
503505
FILE: ../../../flutter/lib/web_ui/lib/src/engine/platform_views.dart
504506
FILE: ../../../flutter/lib/web_ui/lib/src/engine/plugins.dart
505507
FILE: ../../../flutter/lib/web_ui/lib/src/engine/pointer_binding.dart
@@ -554,6 +556,7 @@ FILE: ../../../flutter/lib/web_ui/lib/src/ui/natives.dart
554556
FILE: ../../../flutter/lib/web_ui/lib/src/ui/painting.dart
555557
FILE: ../../../flutter/lib/web_ui/lib/src/ui/path.dart
556558
FILE: ../../../flutter/lib/web_ui/lib/src/ui/path_metrics.dart
559+
FILE: ../../../flutter/lib/web_ui/lib/src/ui/platform_dispatcher.dart
557560
FILE: ../../../flutter/lib/web_ui/lib/src/ui/pointer.dart
558561
FILE: ../../../flutter/lib/web_ui/lib/src/ui/semantics.dart
559562
FILE: ../../../flutter/lib/web_ui/lib/src/ui/test_embedding.dart

lib/ui/compositing.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ part of dart.ui;
1010
///
1111
/// To create a Scene object, use a [SceneBuilder].
1212
///
13-
/// Scene objects can be displayed on the screen using the
14-
/// [Window.render] method.
13+
/// Scene objects can be displayed on the screen using the [FlutterView.render]
14+
/// method.
1515
@pragma('vm:entry-point')
1616
class Scene extends NativeFieldWrapperClass2 {
1717
/// This class is created by the engine, and should not be instantiated
@@ -186,7 +186,7 @@ class PhysicalShapeEngineLayer extends _EngineLayerWrapper {
186186

187187
/// Builds a [Scene] containing the given visuals.
188188
///
189-
/// A [Scene] can then be rendered using [Window.render].
189+
/// A [Scene] can then be rendered using [FlutterView.render].
190190
///
191191
/// To draw graphical operations onto a [Scene], first create a
192192
/// [Picture] using a [PictureRecorder] and a [Canvas], and then add
@@ -655,13 +655,13 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
655655
/// - 0x08: visualizeEngineStatistics - graph UI thread frame times
656656
/// Set enabledOptions to 0x0F to enable all the currently defined features.
657657
///
658-
/// The "UI thread" is the thread that includes all the execution of
659-
/// the main Dart isolate (the isolate that can call
660-
/// [Window.render]). The UI thread frame time is the total time
661-
/// spent executing the [Window.onBeginFrame] callback. The "raster
662-
/// thread" is the thread (running on the CPU) that subsequently
663-
/// processes the [Scene] provided by the Dart code to turn it into
664-
/// GPU commands and send it to the GPU.
658+
/// The "UI thread" is the thread that includes all the execution of the main
659+
/// Dart isolate (the isolate that can call [FlutterView.render]). The UI
660+
/// thread frame time is the total time spent executing the
661+
/// [PlatformDispatcher.onBeginFrame] callback. The "raster thread" is the
662+
/// thread (running on the CPU) that subsequently processes the [Scene]
663+
/// provided by the Dart code to turn it into GPU commands and send it to the
664+
/// GPU.
665665
///
666666
/// See also the [PerformanceOverlayOption] enum in the rendering library.
667667
/// for more details.
@@ -802,7 +802,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
802802
///
803803
/// Returns a [Scene] containing the objects that have been added to
804804
/// this scene builder. The [Scene] can then be displayed on the
805-
/// screen with [Window.render].
805+
/// screen with [FlutterView.render].
806806
///
807807
/// After calling this function, the scene builder object is invalid and
808808
/// cannot be used further.

lib/ui/compositing/scene.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ Scene::Scene(std::shared_ptr<flutter::Layer> rootLayer,
4242
uint32_t rasterizerTracingThreshold,
4343
bool checkerboardRasterCacheImages,
4444
bool checkerboardOffscreenLayers) {
45+
// Currently only supports a single window.
4546
auto viewport_metrics = UIDartState::Current()
4647
->platform_configuration()
47-
->window()
48+
->get_window(0)
4849
->viewport_metrics();
4950

5051
layer_tree_ = std::make_unique<LayerTree>(

lib/ui/dart_ui.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dart_ui_files = [
1313
"//flutter/lib/ui/lerp.dart",
1414
"//flutter/lib/ui/natives.dart",
1515
"//flutter/lib/ui/painting.dart",
16+
"//flutter/lib/ui/platform_dispatcher.dart",
1617
"//flutter/lib/ui/plugins.dart",
1718
"//flutter/lib/ui/pointer.dart",
1819
"//flutter/lib/ui/semantics.dart",

0 commit comments

Comments
 (0)