79 Commits

Author SHA1 Message Date
Greg Spencer
06b6f8af89 Reland: Migration to PlatformDispatcher and multi-window (flutter/engine#21932)
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.
2020-10-22 14:54:25 -07:00
Yuqian Li
0c645869e3 Revert "Migration to PlatformDispatcher and multi-window #20496" (flutter/engine#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit a539d91840d2fbbb4aa07eeed6a92d654db167ab.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit a58fec63f196175eedfc5fbaedce9336dab5c508.
2020-10-12 19:26:41 -07:00
Greg Spencer
a58fec63f1 Migration to PlatformDispatcher and multi-window (flutter/engine#20496)
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.
2020-10-09 16:29:16 -07:00
Yuqian Li
9fdea6bbbc Do not remove directories in purge (flutter/engine#21478)
Otherwise, the persistent cache may hold invalid directories and make
subsequent store fail.

The newly added unit tests would fail without the fix.
2020-10-05 20:05:00 -07:00
Dan Field
f83e92cbaf Use hint freed specifically for image disposal (flutter/engine#20754)
* Use hint freed specifically for image disposal
2020-09-02 13:41:58 -07:00
Dan Field
35d014eee7 Revert hint_freed (flutter/engine#20746)
This caused over-aggressive GCs, which vastly increased CPU usage benchmarks.

* Revert "fix build (#20644)"

This reverts commit 5e03f90cdd9392f95b47d08b398c18cab6d16b12.

* Revert "Hint freed (#19842)"

This reverts commit 73490a2ca444c8ca491712cde21a459453af8795.
2020-08-25 11:55:40 -07:00
Dan Field
73490a2ca4 Hint freed (flutter/engine#19842)
* Hint the VM when a layer or picture goes out of scope
2020-08-19 14:04:31 -07:00
Chris Yang
72162b7a66 Ensure threads are merged when tearing down the Rasterizer (flutter/engine#19919) 2020-08-19 08:31:01 -07:00
David Worsham
ad2bff1014 Reland: "fuchsia: Remove dead code / break dependencies" (flutter/engine#20532)
Reland #19396 with a fix for improper scale that was affecting internal tests

Tested: Ran all unittests, ran internal tests, and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-14 20:41:18 -07:00
Yuqian Li
4dec444c69 Add a service protocol for raster cache memory (flutter/engine#20466)
Related issue: https://github.com/flutter/flutter/issues/56719
2020-08-13 20:11:47 -07:00
Dan Field
b43d17a5a3 Remove the dummy rasterizer delegate now that flutter_runner is in tree, and cleanup ctor params (flutter/engine#20486) 2020-08-13 14:46:01 -07:00
Zachary Anderson
275f2b04cc Revert "fuchsia: Remove dead code / break dependencies (#19396)" (flutter/engine#20302)
This reverts commit 017f07942e8e80a4e886def19c6fffac7ce18479.
2020-08-06 12:06:06 -07:00
David Worsham
017f07942e fuchsia: Remove dead code / break dependencies (flutter/engine#19396)
The fuchsia code around metrics and sizing was just sending this
information through a side-channel, when the engine already had the
information available. So, delete all of it to make future CLs simpler.

Additionally, the SceneUpdateContext has many unneccesary dependencies
re: metrics and PaintTasks. Break those to make future CLs simpler.

Tested: Ran all unittests and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-03 22:09:26 -07:00
Zachary Anderson
95b2fed2dc Enable more linting (flutter/engine#20187) 2020-07-31 21:30:58 -07:00
Greg Spencer
e994f832d2 Move platform specific information to PlatformConfiguration class (flutter/engine#19652) 2020-07-31 17:21:02 -07:00
liyuqian
02f828632c Use FixtureTest to remove duplicate code (flutter/engine#19219)
Fixes https://github.com/flutter/flutter/issues/59109
2020-06-30 10:55:38 -07:00
Kaushik Iska
ce2baf1ce0 Revert "Remove pipeline in favor of layer tree holder (#18901)" (flutter/engine#19066)
Reverting for b/158816279
2020-06-16 13:15:57 -07:00
Kaushik Iska
1430d4e26b Remove pipeline in favor of layer tree holder (flutter/engine#18901)
Relanding of a change that was reverted in:
https://github.com/flutter/engine/pull/18427
2020-06-09 12:19:34 -07:00
gaaclarke
851f2e76b0 Made the Rasterizer avoid GPU calls when backgrounded (flutter/engine#18563) 2020-05-26 21:02:40 -07:00
Kaushik Iska
5519277f4a Revert "Remove pipeline in favor of layer tree holder (#18285)" (flutter/engine#18427)
This reverts commit 0219ee95d8ffdef4d839f0419ce5e1f22b27d8d1.
2020-05-15 12:27:32 -07:00
Kaushik Iska
0219ee95d8 Remove pipeline in favor of layer tree holder (flutter/engine#18285)
go/flutter-pipeline-improvements for more details.
2020-05-14 10:46:14 -07:00
Kaushik Iska
1785bb19b0 Revert "Remove pipeline in favor of layer tree holder (#17688)" (flutter/engine#18242) 2020-05-08 16:09:02 -07:00
Kaushik Iska
dee9634111 Remove pipeline in favor of layer tree holder (flutter/engine#17688)
go/flutter-pipeline-improvements for more details.
2020-05-08 10:51:10 -07:00
Chris Yang
8500bd4156 Reland "Improve iOS PlatformViews to better handle thread merging. #16935" (flutter/engine#17609) 2020-04-10 13:25:02 -07:00
liyuqian
6c93145ef5 Read SkSLs from asset (flutter/engine#17601)
Fixes https://github.com/flutter/flutter/issues/53117

Test added:
- ShellTest.CanLoadSkSLsFromAsset
2020-04-10 00:16:33 -07:00
Chris Yang
efe45cd875 Revert "Improve iOS PlatformViews to better handle thread merging. (#16935)" (flutter/engine#17600)
This reverts commit 930696bbb75ffdb098df4081e0353f4fac38b075.
2020-04-08 21:15:38 -07:00
Chris Yang
930696bbb7 Improve iOS PlatformViews to better handle thread merging. (flutter/engine#16935) 2020-04-08 17:33:33 -07:00
Kaushik Iska
ce0ec9042f [pipeline] Add trace event for lag between target and display times (flutter/engine#17384)
This change also adds TimeRecorder which records time at the start
of each frame to capture the latest vsync target display time and
wires it in to the rasterizer to add trace events when there is a lag.
2020-04-02 17:15:45 -07:00
liyuqian
b5318d05ff More rename from GPU thread to raster thread (flutter/engine#17408)
This PR touches variable names, class names, and file names so it's significantly more risky than its predecessor https://github.com/flutter/engine/pull/17329

Due to file name changes, this PR is expected to change the license files.

We haven't rename `shell/gpu` to `shell/raster` yet. It should be optional but I think it's better to have `raster_surface_software.cc` than `gpu_surface_software.cc`.
2020-03-31 14:05:28 -07:00
liyuqian
10824995dd Rename GPU thread to raster thread in code comments (flutter/engine#17329)
1. Simple "GPU thread" to "raster thread" replacement.

2. Regex replace "GPU([\n\r\s]+//+ thread)" with "raster$1".

3. Regex replace "// gpu$" with "// raster".

4. Simple test change.

5. Run ci/format.sh
2020-03-25 22:49:59 -07:00
liyuqian
d968e224ca Add service protocol to get SkSLs (flutter/engine#17300)
Fixes https://github.com/flutter/flutter/issues/53114
2020-03-24 21:42:12 -07:00
George Wright
e2e15d08e4 Enable verbose logging for shell unittests on Fuchsia (flutter/engine#16526) 2020-02-10 14:39:03 -08:00
George Wright
69e635c0fc Enable shell_unittests on Fuchsia with Vulkan dependencies. (flutter/engine#16376)
This also adds a dependency on SwiftShader's Vulkan frontend.
2020-02-06 15:07:01 -08:00
Chinmay Garde
2a949ca345 Isolate and move common portable ELF loading from fixtures into //flutter/testing. (flutter/engine#16305)
Also update all known test harnesses to use this and fixes the broken shell_unittests harness.

Fixes https://github.com/flutter/flutter/issues/49853
2020-01-31 12:52:00 -08:00
George Wright
2d2da1dd64 Refactor ShellTest to allow for different ShellTestPlatformViews (flutter/engine#15972)
This paves the way for us to have shell_unittests backed by different rendering APIs (e.g. OpenGL, Vulkan, Metal).
2020-01-24 13:29:12 -08:00
Kaushik Iska
76d887b711 Reland Wire up Opacity on Fuchsia (flutter/engine#14559)
This reverts commit 6919709e47661c5cd48d9b0d3bfde986b9c1af84.

On top of the revert, it reverted a commit in the PR:
https://github.com/flutter/engine/pull/14024

This reverts commit ea67e5b0b930ebf552bc7dbd678a35ee6a129c39.
2019-12-18 16:05:38 -08:00
Kaushik Iska
6919709e47 Revert "Wire up Opacity on Fuchsia, round 2 (#14024)" (flutter/engine#14543)
This reverts commit cb0aca7f74a34a6a79f6b7123bd0643a135cf56a.
2019-12-18 10:29:47 -08:00
Kaushik Iska
1150b2e5af [testing] Make vsync waiters pluggable in shell_unittests (flutter/engine#14463)
This makes it so that the platform views can be passed
an arbitraty CreateVsyncWaiter callback that lets us inject
a vsync waiter other than just the simulated monotonic vsync waiter
that currently exists.
2019-12-12 14:15:36 -08:00
Kaushik Iska
10205291d4 [testing] Move test vsync waiters to their own TUs (flutter/engine#14456)
This move makes it easier to add more vsync waiters.
2019-12-12 12:27:56 -08:00
Kaushik Iska
aca6a4f55a [tests] Use distinct begin and end times (flutter/engine#14361) 2019-12-11 17:23:49 -08:00
David Worsham
cb0aca7f74 Wire up Opacity on Fuchsia, round 2 (flutter/engine#14024)
* Remove erroneous ChildView opacity

* Wire frame metrics through contexts

* Maintain layer stack inside of SceneBuilder

* Remove EnsureSingleChild

* Centralize system-composite and elevation logic

* Wire up OpacityLayer to Scenic
2019-12-04 19:29:31 -08:00
David Worsham
df08c2593a Relanding: Add Flow unittests and fixtures (flutter/engine#14091) 2019-12-03 14:33:02 -08:00
liyuqian
52e74298e0 Revert PRs to unblock David and Jim's work (flutter/engine#14088)
* Revert "Add flow test fixtures and tests (#13986)"

This reverts commit 32915132bacdfd0d631421b23bb6a6d5db1095ab.

* Revert "Dynamically determine whether to use offscreen surface based on need (#13976)"

This reverts commit a13401ce86b3019c39154d56644b7b9eb4a5bbe5.
2019-12-03 12:02:37 -08:00
David Worsham
32915132ba Add flow test fixtures and tests (flutter/engine#13986) 2019-12-03 09:43:02 -08:00
chunhtai
d053943e7c Moves pointer event sanitizing to engine. (flutter/engine#13697)
* Moves pointer event sanitizing to engine

* fix comment format

* fix formatting

* addressing comment

* fix format

* fix format

* addressing comment
2019-11-19 09:48:25 -08:00
Todd Volkert
02a18868b3 Revert "RendererContextSwitch guard flutter's gl context rework. (#13812)" (flutter/engine#13906)
This reverts commit 7552e9370527aae8df06b43dcb6b313d9ebdb365.

This is being reverted because it caused flutter/flutter#45098
(images don't load on iOS).
2019-11-18 18:28:04 -08:00
Chris Yang
7552e93705 RendererContextSwitch guard flutter's gl context rework. (flutter/engine#13812) 2019-11-14 11:50:45 -08:00
Chris Yang
590dc94eb8 Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13759)" (flutter/engine#13788)
This reverts commit 6390e62036d69c4923cc6cf2379b9eb9f25870ba.
2019-11-11 17:17:18 -08:00
Chris Yang
6390e62036 Reland "Guarding EAGLContext used by Flutter #13314" (flutter/engine#13759) 2019-11-08 20:09:18 -08:00
Chris Yang
68754a85f0 Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13755)" (flutter/engine#13757)
This reverts commit a4a346f317c867663a6d8a5d9c7909101d9b5cbd.
2019-11-08 13:44:29 -08:00