49 Commits

Author SHA1 Message Date
Jim Graham
46a8def326 Opacity peephole optimization (flutter/engine#29775) 2021-12-14 16:19:09 -08:00
Matej Knopp
66a708c874 Enable partial repaint for iOS/Metal (flutter/engine#28801) 2021-11-02 07:20:01 -07:00
David Worsham
5e5fe01dd2 Reland "fuchsia: Delete all the legacy code! (#26422)" (flutter/engine#27075)
This reverts commit bb3c49a9c3edf931a5601f0245faa85f5e077cb4.
2021-06-30 15:43:21 -07:00
David Worsham
bad9b71a01 Revert "fuchsia: Delete all the legacy code! (#26422)" (flutter/engine#26637)
This reverts commit 9afd7d6af8a0d023c0db67d24c55eb6c08c48aba.
2021-06-08 12:47:44 -07:00
David Worsham
9afd7d6af8 fuchsia: Delete all the legacy code! (flutter/engine#26422) 2021-06-07 17:29:39 -07:00
Matej Knopp
7de5184eb9 Add DiffContext (flutter/engine#21824) 2021-02-18 14:41:01 -08:00
Jim Graham
949d20ee2e Move layer clip culling to Paint() method to fix child caching (flutter/engine#22336) 2020-11-13 15:23:03 -08:00
Kaushik Iska
2b337d1d98 Reland fuchsia external view embedder will be shared with platform view (flutter/engine#22008)
* Reland fuchsia external view embedder will be shared with platform view

This reverts commit cecec62028b09097675f041a7203708b99d4d2c6.

* wait for the external view embedder to be initialized before creating
shell
2020-10-22 13:48:36 -07:00
Ren You
cecec62028 Revert "[fuchsia] External view embedder will be shared with platform view (#21850)" (flutter/engine#21924)
This reverts commit 8b0b5acd5a8a5db5a77de78e9f89cf931fa9f688.
2020-10-16 15:25:13 -07:00
Kaushik Iska
8b0b5acd5a [fuchsia] External view embedder will be shared with platform view (flutter/engine#21850) 2020-10-15 17:22:02 -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
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
David Worsham
919f8e6a42 Move fuchsia/scenic integration behind #define (flutter/engine#19003)
Additionally create "_next" permutations for all of the test binaries
on Fuchsia, in order to test both code-paths.

Using the #define follow-up CLs can also create a flutter_runner_next
binary that does not contain any legacy integration code.

BUG: 53847
2020-06-26 14:03:18 -07:00
mikejurka
8bb493406e [Fuchsia] Move physical shape layer compositing to Flutter (flutter/engine#17005)
* [fuchsia] Add labels to Scenic nodes.

* [fuchsia] Skip creating Scenic nodes for identity Transforms.

* [fuchsia] Assign elevation to Scenic nodes based on paint order.

* [fuchsia] Create Scenic OpacityNodes at leaf nodes.

* [fuchsia] Composite PhysicalShapeLayers using Skia, except when they need to float above child views.

In that case, they will still need to be pulled
into separate Scenic nodes to be composited on top
of the child view[s].

* [fuchsia] Add tests for Fuchsia-specific layer behavior.

Inspect commands going to Scenic and make sure
they match what is expected.

Also, restructure code to need less member variables,
and other cleanups based on review feedback.
2020-03-23 16:38:07 -07:00
David Worsham
ec3aedb2f2 Fix Opacity performance regression on Fuchsia (flutter/engine#15573)
* Add more profile markers

* Revert FuchsiaSystemCompistedLayer changes

* Re-add opacity w/o elevation changes

* Fix formatting
2020-01-16 15:28:48 -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
liyuqian
2778d3bb20 Revert "[fuchsia] Wire up OpacityLayer to Scenic (#11322)" (flutter/engine#12610)
This reverts commit 639cc113f0b2ccf9fcf69ded7960d41d0b611f80.

Fixes https://github.com/flutter/flutter/issues/41394 and other
related correctness issues.

TBR: @arbreng @jason-simmons @mehmetf
2019-09-27 16:50:43 -07:00
David Worsham
639cc113f0 [fuchsia] Wire up OpacityLayer to Scenic (flutter/engine#11322)
On Fuchsia, add a build flag for compositing OpacityLayers using the system
compositor vs Skia, which exposes a fastpath for opacity via Scenic.
This will only work under certain circumstances, in particular nested
OpacityLayers will not render correctly!

On Fuchsia, add a build flag for compositing PhysicalShapeLayers using
the system compositor vs Skia. Set to off by default, which restores
performant shadows on Fuchsia.

Remove the opacity exposed from ChildView, as that was added mistakenly.

Finally, we centralize the logic for switching between the
system-composited and in-process-composited paths inside of
ContainerLayer. We also centralize the logic for computing elevation
there. This allows the removal of many OS_FUCHSIA-specific code-paths.

Test: Ran workstation on Fuchsia; benchmarked before and after
Bug: 23711
Bug: 24163

* Fix broken tests
2019-09-25 12:48:42 -04:00
Chris Yang
e5bc87a4cd Mutators Stack refactoring (flutter/engine#9663)
Rename methods in the MutatorsStack to Pascal case to match standard cpp style
Refactor the operator== for Mutator class
2019-07-03 11:18:14 -07:00
Chris Yang
cec3b15298 Move the mutators stack handling to preroll (flutter/engine#9651)
* refactoring to move the mutator stack handling to preroll

* more review fixes
2019-07-02 16:35:47 -07:00
Chris Yang
bb909453ea Reland "IOS Platform view transform/clipping (#9075)" and fix the breakage. (flutter/engine#9483)
* Revert "Revert "IOS Platform view transform/clipping (#9075)" (#9480)"

This reverts commit 52ceaee505a26b6bad893e38b33c522d1e0ba571.

* fix fuschia buid
2019-06-25 15:29:47 -07:00
Chris Bracken
52ceaee505 Revert "IOS Platform view transform/clipping (#9075)" (flutter/engine#9480)
This reverts commit 5625d01b324f5a0d94aaa916d9e08fd038e363b3.

Seeing the following breakage on host build:
```
../../flutter/flow/scene_update_context.cc:205:36: error: non-const lvalue reference to type 'flutter::MutatorsStack' cannot bind to a value of unrelated type 'const flutter::Stopwatch'
                                   frame.context().raster_time(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:207:36: error: no viable conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch'
                                   frame.context().texture_registry(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/instrumentation.h:55:32: note: candidate constructor not viable: no known conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch &' for 1st argument
  FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
                               ^
../../flutter/fml/macros.h:28:3: note: expanded from macro 'FML_DISALLOW_COPY_AND_ASSIGN'
  TypeName(const TypeName&) = delete;          \
  ^
../../flutter/flow/scene_update_context.cc:208:36: error: non-const lvalue reference to type 'flutter::TextureRegistry' cannot bind to a temporary of type 'flutter::RasterCache *'
                                   &frame.context().raster_cache(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:209:36: error: cannot initialize a member subobject of type 'const flutter::RasterCache *' with an rvalue of type 'bool'
                                   false};
                                   ^~~~~
```
2019-06-25 10:48:37 -07:00
Chris Yang
5625d01b32 IOS Platform view transform/clipping (flutter/engine#9075) 2019-06-25 09:33:50 -07:00
liyuqian
4b958d852b Set identity instead of crash in opt build (flutter/engine#9262)
According to https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#expectations-around-potential-crashes-in-the-engine

This should address https://github.com/flutter/flutter/issues/31650#issuecomment-494935507

We'll instead use `FML_LOG(ERROR)` to report errors to our CI tests. See https://github.com/flutter/flutter/issues/34194
2019-06-13 09:35:54 -07:00
Zachary Anderson
35107c4dca Revert tracing changes (flutter/engine#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit e7d406fe36790b1a8161d4687a6a4a144ba44254.

* Revert "Align fuchsia and non-fuchsia tracing (#9199)"

This reverts commit 1ccb372e5f8ceaaf90f5b43b42df617d7f18d955.
2019-06-12 10:25:49 -07:00
liyuqian
43f4c1d3c7 Make flow layers' attributes immutable (flutter/engine#9176)
For https://github.com/flutter/flutter/issues/33807

We still need to make layers' children immutable for full immutability.
That will require us to change the SceneBuilder API to build the layer
bottom up instead of top down (post-order traversal instead of pre-order
traversal).
2019-06-10 13:09:37 -07:00
Dan Field
1ccb372e5f Align fuchsia and non-fuchsia tracing (flutter/engine#9199) 2019-06-05 15:14:27 -07:00
liyuqian
41077726ae Check the matrix in pushTransform (flutter/engine#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
liyuqian
27e4dac06b Rename flow namespace to flutter (flutter/engine#8615)
This follows our namespace change from shell to flutter: https://github.com/flutter/engine/pull/8520.
2019-04-17 14:38:45 -07:00
liyuqian
6a28ed4830 Check that TransformLayer has a finite matrix (flutter/engine#8585)
To catch issues like https://github.com/flutter/flutter/issues/30586

https://github.com/flutter/flutter/pull/31097 will trigger this CHECK
if https://github.com/flutter/engine/pull/8467 were reverted and the
transform_ were not initialized in this PR.
2019-04-16 20:36:25 -07:00
Jason Simmons
5be5c16460 Redo a fix for cull rect calculation on TransformLayers with a perspective transform (flutter/engine#8528)
This was originally implemented in 6eab9d08be
but was not retained when cull rects were removed from the SceneBuilder.

Fixes https://github.com/flutter/flutter/issues/30819
2019-04-10 13:00:05 -07:00
liyuqian
3f5e53a4c7 Compute cull_rect and optimize in Layer::Preroll (flutter/engine#6923)
This PR replaces the unused `PrerollContext::child_paint_bounds` with `PrerollContext::cull_rect` so we can prune unnecessary preroll tasks (especially cache) based on clips. This PR fixes https://github.com/flutter/flutter/issues/24712

Performance test has been added (https://github.com/flutter/flutter/pull/25381) to make sure that we won't regress again in the future.

Note that the cull_rect here is very similar to those removed in https://github.com/flutter/engine/pull/6352 .     We can't compute cull rects in SceneBuilder because of retained layers. But we can still compute and use them to optimize performance in Preroll.
2018-12-18 09:54:52 -08:00
Amir Hardon
d6e19afcb5 Add an internal_nodes_canvas to PaintContext. (flutter/engine#6728)
When we visit a PlatformViewLayer during the paint traversal it replaces
the PaintContext's canvas with a new one that is painted ontop of the
embedded view.
We need to make sure that operations applied by parent layers are also
applied to the new canvas.

To achieve this we collect all the canvases in a SkNWayCanvas and use
this canvas by non leaf nodes. Leaf nodes still paint only to the "current"
canvas.

This PR moves the overlay canvas creation from the paint phase to the
preroll phase, collects them into a SkNWayCanvas and set it in
PaintContext.

To keep this PR focused, I only used the internal_nodes_canvas in the
tranform_layer.
Will followup with a PR that changes all internal layers to use the
internal_nodes_canvas.
2018-11-08 09:31:40 -08:00
Michael Goderbauer
0def82ddb0 Unify copyright lines (flutter/engine#6757) 2018-11-07 12:24:35 -08:00
Amir Hardon
bebedc379d Add an overlay surface on top of embedded UIViews. (flutter/engine#6726)
The overlay surfaces are going to be the same IOSSurface implementation
with the platform views controller set to null (so these are surfaces
that don't support embedding platform views to them).

  * Adds a FlutterOverlayView which is a UIView that's showing an
    overlay surface.
  * Creates an overlay surface for each embedded UIView (done in
    FlutterPlatformViewsController).
  * Changes CompositeEmbeddedView to return a new canvas.
  * Makes the PlatformViewLayer replace the PaintContext's canvas with
    the canvas for the overlay view.
  * Changed canvas in PaintContext to be a pointer so it can be changed.

TBD in following PRs:
  * Copy the current canvas state when replacing a canvas in PaintContext.
  * Make FlutterOverlayView work with a GL backend (currently it only
    works with software rendering)
2018-11-01 17:45:16 -07:00
Chinmay Garde
6ab2c166fd Remove all dependencies on Garnet. (flutter/engine#5869) 2018-07-26 12:49:34 -07:00
Chinmay Garde
eac6438ce8 Make flow::Layer::Paint const. (flutter/engine#4200) 2017-10-11 16:48:31 -07:00
George Kulakowski
fa539e618e Rename ftl to fxl in Fuchsia specific code (flutter/engine#4090) 2017-09-11 15:58:48 -07:00
Chinmay Garde
f7b67119d3 Update the content handler to use the Mozart session API. (flutter/engine#3887) 2017-07-18 15:40:18 -07:00
P.Y. Laligand
19a7291579 Prevent GN from choking on conditional imports. (flutter/engine#3805) 2017-06-20 23:39:18 -07:00
Adam Barth
6e603372ba Composite child views in proper paint order (flutter/engine#3243)
We push a bit up the tree during preroll to learn whether there system
composited layers below each layer. During update scene, we squash down
to paint tasks, which we execute after publishing the new scene.
2016-11-18 12:54:54 -08:00
Adam Barth
16584a5a4e Update paths to account for buildroot 2016-08-09 13:52:15 -07:00
Adam Barth
9586997a02 Port //flow to //lib/ftl (flutter/engine#2847)
This patch removes almost all //base dependency of //flow. The only dependency
left is on tracing.
2016-08-01 15:11:56 -07:00
mmclenna
2ecb969075 Additional instrumentation for tracing engine performance (flutter/engine#2682)
* Added instrumentation for timings.

* A few more traces for better granularity.
2016-05-12 13:34:57 -07:00
Adam Barth
75b5912bd2 Break dependency from Layer to PaintContext (flutter/engine#2609)
Instead, make Layer::Paint take a new PaintContext that has just exactly
the state that it needs, mirroring PrerollContext. Also, rename
PaintContext to CompositorContext because it holds the context for the
whole compositor.
2016-04-21 23:05:41 -07:00
Adam Barth
e9171f9608 Move Flow layers to //flow/layers 2016-01-30 23:35:22 -08:00