Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 16, 2020

Description

This re-lands #20496 and #21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

  • Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
  • Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).

Next step after this PR lands:

  • Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

    The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.

Related Issues

Tests

  • Existing tests pass, as do Framework tests.
  • Tests were modified to use the new platform dispatcher instead of the window singleton.

Breaking Change

  • No, this is not a breaking change, either for the embedding API or for the Framework.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog force-pushed the multi_window branch 2 times, most recently from c8b0a4b to 7bd1d10 Compare October 20, 2020 17:56
@gspencergoog gspencergoog merged commit 6bc70e4 into flutter:master Oct 22, 2020
@gspencergoog gspencergoog deleted the multi_window branch October 22, 2020 21:54
@Hixie
Copy link
Contributor

Hixie commented Oct 22, 2020

@gspencergoog Looks like this conflicted pretty heavily with #21572, if you have any advice on how to merge that PR in it would be much appreciated. (Not critical, I'll look at it on Monday and try to figure it out.)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 23, 2020
@gspencergoog
Copy link
Contributor Author

@Hixie Yes, I can help you out with that: it's pretty hairy, I agree. Mostly the bodies of the functions moved to static functions on PlatformDispatcher, and the platform message dispatch mechanism moved there too (because that's a main point of the class). They mostly weren't changed, just moved.

I'll see if I can try a merge today and send you a diff to apply.

zanderso pushed a commit to flutter/flutter that referenced this pull request Oct 23, 2020
* 000bf4b Roll Skia from 2d2f82c00aeb to 5c7bb326a7b3 (33 revisions) (flutter/engine#22059)

* ae92dbf Roll Fuchsia Linux SDK from lPMs_KwnU... to gqS_DIjN4... (flutter/engine#22057)

* 92cd74e Roll Fuchsia Mac SDK from pZ9FgVZTK... to WLxBkBnZa... (flutter/engine#22055)

* e51c710 Roll Dart SDK from a3d902d8598e to 9f907e198970 (2 revisions) (flutter/engine#22058)

* 326b202 Reland fuchsia external view embedder will be shared with platform view (flutter/engine#22008)

* a9a9a2f Roll Skia from 5c7bb326a7b3 to 65674e4c2e56 (3 revisions) (flutter/engine#22060)

* 1233fe4 Revert "Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)" (flutter/engine#21871)

* aed8e01 Fixes Edge trigger route change announcement (flutter/engine#21975)

* 6bc70e4 Reland: Migration to PlatformDispatcher and multi-window (flutter/engine#21932)

* 5ca5e26 Add FlEventChannel (flutter/engine#21316)

* 77b0052 Roll Skia from 65674e4c2e56 to 01b05e5b830b (3 revisions) (flutter/engine#22062)

* 3d27fd5 Support loading assets from Android dynamic feature modules (flutter/engine#21504)

* 742dfbe support uri intent launcher in android (flutter/engine#21275)

* cde1e3f Auto detect mode to determine which rendering backend to use. (flutter/engine#21852)

* 329ccf7 Roll Skia from 01b05e5b830b to 53281c712159 (1 revision) (flutter/engine#22065)

* cde78c1 Add a golden scenario test for fallback font rendering on iOS take 2 (flutter/engine#22033)

* 4f4599b Roll Dart SDK from 9f907e198970 to 37ccceacad41 (3 revisions) (flutter/engine#22069)

* f0b10c5 [web] Prevent using DOM nodes for canvas with large number of draws (flutter/engine#22064)

* a86ba57 Roll Fuchsia Mac SDK from WLxBkBnZa... to zDfaxkqlv... (flutter/engine#22073)

* 645198a Roll Fuchsia Linux SDK from gqS_DIjN4... to vuKxZmSVj... (flutter/engine#22074)

* 0b26570 Revert dart rolls (flutter/engine#22078)
@IvanVishnevskiy
Copy link

Does this mean we will get multiple windows in flutter rather soon-ish?

@gspencergoog
Copy link
Contributor Author

@IvanVishnevskiy It's going to be a while. There is still a lot of work left to do, both in the engine and the framework.

chaselatta pushed a commit to chaselatta/engine that referenced this pull request Nov 30, 2020
This re-lands flutter#20496 and flutter#21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants