34 Commits

Author SHA1 Message Date
David Worsham
04274160e6 Fix Opacity performance regression on Fuchsia (#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
2fc1e1bce1 Relanding: Add Flow unittests and fixtures (#14091) 2019-12-03 14:33:02 -08:00
liyuqian
84bf72917c
Revert PRs to unblock David and Jim's work (#14088)
* Revert "Add flow test fixtures and tests (#13986)"

This reverts commit 620f5281b819f304e8e9e945222e26b17b087cc3.

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

This reverts commit a86ef946563b020108320bbfb974bf7343284fd3.
2019-12-03 12:02:37 -08:00
David Worsham
620f5281b8 Add flow test fixtures and tests (#13986) 2019-12-03 09:43:02 -08:00
liyuqian
7c3dcee2e9
Revert "[fuchsia] Wire up OpacityLayer to Scenic (#11322)" (#12610)
This reverts commit fcc4ab32301396986dd5103d6d444bff35fe0f63.

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
fcc4ab3230
[fuchsia] Wire up OpacityLayer to Scenic (#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
cea2c3617f
Mutators Stack refactoring (#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
8306ee68c7 Move the mutators stack handling to preroll (#9651)
* refactoring to move the mutator stack handling to preroll

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

This reverts commit 00d929f7f6088375b006746718a65b84678d01c0.

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

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
ebb5b909fb
IOS Platform view transform/clipping (#9075) 2019-06-25 09:33:50 -07:00
liyuqian
f1d821d8fd
Set identity instead of crash in opt build (#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
0a2e28d797
Revert tracing changes (#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit f80ac5f571479053b134e60bca77603269b2ce2a.

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

This reverts commit 78265484623037c6544dfd5380367bca29fa27b0.
2019-06-12 10:25:49 -07:00
liyuqian
b622d43c39
Make flow layers' attributes immutable (#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
7826548462
Align fuchsia and non-fuchsia tracing (#9199) 2019-06-05 15:14:27 -07:00
liyuqian
50de4692a5
Check the matrix in pushTransform (#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
liyuqian
8ff631f3df
Rename flow namespace to flutter (#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
3b016106c7
Check that TransformLayer has a finite matrix (#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
36d2135ad0
Redo a fix for cull rect calculation on TransformLayers with a perspective transform (#8528)
This was originally implemented in d217a95126
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
ba117366ef
Compute cull_rect and optimize in Layer::Preroll (#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
387ca2ef86
Add an internal_nodes_canvas to PaintContext. (#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
70a1106b50
Unify copyright lines (#6757) 2018-11-07 12:24:35 -08:00
Amir Hardon
9e1f546a85
Add an overlay surface on top of embedded UIViews. (#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
9f8285ac6c
Remove all dependencies on Garnet. (#5869) 2018-07-26 12:49:34 -07:00
Chinmay Garde
a55aa23078 Make flow::Layer::Paint const. (#4200) 2017-10-11 16:48:31 -07:00
George Kulakowski
3aa7522c11 Rename ftl to fxl in Fuchsia specific code (#4090) 2017-09-11 15:58:48 -07:00
Chinmay Garde
925298d947 Update the content handler to use the Mozart session API. (#3887) 2017-07-18 15:40:18 -07:00
P.Y. Laligand
f61869eba0 Prevent GN from choking on conditional imports. (#3805) 2017-06-20 23:39:18 -07:00
Adam Barth
21f6aa5270 Composite child views in proper paint order (#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
9c09565712 Update paths to account for buildroot 2016-08-09 13:52:15 -07:00
Adam Barth
d6476a65c3 Port //flow to //lib/ftl (#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
43c108dae8 Additional instrumentation for tracing engine performance (#2682)
* Added instrumentation for timings.

* A few more traces for better granularity.
2016-05-12 13:34:57 -07:00
Adam Barth
b9ff394182 Break dependency from Layer to PaintContext (#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
c3c5af1fbe Move Flow layers to //flow/layers 2016-01-30 23:35:22 -08:00