265 Commits

Author SHA1 Message Date
freiling
f6d9154d24 [scenic][SCN-1054] Move back off of SetTranslationRH (flutter/engine#8174)
The behavior of SetTranslation() is now in its final state so we can migrate
back off the temporary function.
2019-03-18 16:33:57 -07:00
liyuqian
ffb58ce65d Clip to clip_rect instead of paint bounds (flutter/engine#8183)
Otherwise, we'll have issues such as https://github.com/flutter/flutter/issues/29070

The engine roll that includes this PR needs a tiny golden image update. Will do a manual roll.
2019-03-18 12:43:41 -07:00
P.Y. Laligand
39b0476967 Fix include of libzx. (flutter/engine#8181) 2019-03-15 13:58:25 -07:00
Kaushik Iska
b98bf7c96c Update overlays_gr_context_ correctly (flutter/engine#8175)
There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: https://github.com/flutter/flutter/issues/28920
2019-03-15 08:35:48 -07:00
Dan Field
bb69b40272 Anti-Aliasing for shape layers (flutter/engine#8157) 2019-03-13 14:26:42 -07:00
Chinmay Garde
0809280550 Reland ""Add support for trace counters with variable arguments and instrument the raster cache." (flutter/engine#8145)
This reverts commit da6e460c67c34d34eef1e9ec87b8534a379fe1f5 and fixes the
discovered on Windows builds.
2019-03-13 13:53:22 -07:00
liyuqian
7ed28478d9 Reland PerformanceOverlayLayer golden test (flutter/engine#8140)
This reverts commit c416fe99ee0ddb464ca85c0b336d679ea626a03c.

Now we shouldn't break the engine build as https://chromium-review.googlesource.com/c/chromium/tools/build/+/1480746 is landed. The golden test is disabled by default and we'll enable it later in our recipe and test it in presubmit tests.
2019-03-12 14:10:11 -07:00
Chinmay Garde
da6e460c67 Revert "Add support for trace counters with variable arguments and instrument the raster cache. (#8094)" (flutter/engine#8122)
This reverts commit 9f384e3e4cbfdf23381509a62c7023e77edcbfd8.
2019-03-11 15:09:24 -07:00
Chinmay Garde
9f384e3e4c Add support for trace counters with variable arguments and instrument the raster cache. (flutter/engine#8094) 2019-03-11 14:44:43 -07:00
liyuqian
87704e2839 Improve shadow doc in PhysicalShapeLayer (flutter/engine#8114)
The old x is confusing as it often refers to x-axis in 2D graphics.
Replace it with t which has a nice interpretation of tangent.
2019-03-11 14:30:07 -07:00
Dan Field
d6245c127f Improve elevation bounds for physical shape layers (flutter/engine#8044)
* improve elevation bounds calculation and add diagram
2019-03-05 16:32:22 -08:00
liyuqian
79c1a3fcdf Move canvas clear after preroll (flutter/engine#7923)
This will reduce 1 render target switch when preroll paints some raster
cache.
2019-02-22 12:48:04 -08:00
Chris Bracken
c416fe99ee Revert "Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (#7911)" (flutter/engine#7916)
This breaks the Linux build with:
```
[ RUN      ] PerformanceOverlayLayer.Gold
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
Golden file not found: "/b/s/w/ir/k/src/flutter/testing/resources"/performance_overlay_gold.png.
Please either set --golden-dir, or make sure that the unit test is run from the right directory (e.g., flutter/engine/src).
```

This reverts commit 3534a2c4cdfa35f921e99466013c7c8b3f03a8c3.
2019-02-21 17:04:34 -08:00
liyuqian
3534a2c4cd Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (flutter/engine#7911)
This reverts commit def147d48ee538dd7bbf0d2f0323a5d90a3d872c.
2019-02-21 15:27:37 -08:00
Chris Bracken
def147d48e Revert "Reland PerformanceOverlayLayer golden test (#7863)" (flutter/engine#7895)
Reverting this broke the flow tests for the performance overlay:

```
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
```

This reverts commit ad96de250ecc47a7c26134ad434150199539b00b.
2019-02-20 20:45:39 -08:00
liyuqian
ad96de250e Reland PerformanceOverlayLayer golden test (flutter/engine#7863)
* Revert "Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (#7765)"

This reverts commit 284016b1e1d6e8badec99cbff907ddb900cd27c4.

* Add command line args for golden dir and font file
2019-02-20 16:49:39 -08:00
liyuqian
dba89c9783 Reland "Lower the threshold to raster cache pictures (#7687)" (flutter/engine#7862)
This reverts commit f2d2383aee62a8fedb784b09a395751105956e03.

https://github.com/flutter/engine/pull/7759 has landed without any
unexpected regressions. Hence we'll reland this as planned.
2019-02-19 14:46:42 -08:00
freiling
352a30e485 [fuchsia][SCN-1054] Map elevation onto -Z in Scenic (flutter/engine#7834)
Note: the SetTranslationRH function is temporary and part of the smooth
transition plan for Scenics handedness inversion. See SCN-1054 for details.

We will follow this will a change to migrate back off SetTranslationRH
Submit after https://fuchsia-review.googlesource.com/c/fuchsia/+/255056
lands in fuchsia.git
2019-02-15 15:32:56 -08:00
Josh Gargus
b9fa0b4ace Add support for new Scenic clip planes. (flutter/engine#7804)
Uses SetClipPlanesCmd in addition to the old clipping approach.
Flutter will use both clipping methods during a transition period
(Scenic will select internally which one to use).
2019-02-12 18:33:14 -08:00
Dan Field
284016b1e1 Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (flutter/engine#7765)
This reverts commit a3b89e97a89a1c3bd725cf391ff7b6b0fe7e810b.
2019-02-09 00:13:14 -08:00
liyuqian
6a320ce6ae Throttle picture raster cache (flutter/engine#7759)
This decreases worst_frame_rasterizer_time_millis from 30ms to 10ms when
we enabled picture raster cache in tiles_scroll (i.e., lower the
threshold from 10 to 5).
2019-02-08 17:40:38 -08:00
liyuqian
a3b89e97a8 Add mock capability to PerformanceOverlayLayer (flutter/engine#7537)
So we can do golden test on PerformanceOverlay to avoid regression like
https://github.com/flutter/flutter/issues/26387
2019-02-08 14:47:22 -08:00
Adam Barth
a10a209d1b [fuchsia] Update path to fuchsia.ui.scenic (flutter/engine#7731)
This target is now in //sdk/fidl.
2019-02-07 22:07:24 -08:00
Adam Barth
0973ddbf05 [fuchsia] Update scenic include (flutter/engine#7708)
This header is now spelled thusly.
2019-02-07 10:45:21 -08:00
liyuqian
f2d2383aee Revert "Lower the threshold to raster cache pictures (#7687)" (flutter/engine#7701)
This reverts commit bea23858792ff59a40b43b14a57fc0f3ba0ab739.
2019-02-05 16:02:44 -08:00
liyuqian
bea2385879 Lower the threshold to raster cache pictures (flutter/engine#7687)
After removing clips by default, the OpCount of a picture drops
significantly. That makes our old threshold suboptimal. The new
threshold reflects the clip change and will improve our scroll
performance by ~10% for complex_layout and flutter_gallery scroll
benchmarks:

(flutter_gallery) home_scroll_perf frame raster time:
average		9.1ms	-> 7.4ms
90th_percentile	11.3ms	-> 9.2ms
99th_percentile	45ms	-> 38ms

complex_layout_scroll_perf frame raster time:
average		4.8	-> 4.4ms
90th_percentile	7.8ms	-> 5.4ms
99th_percentile	19ms	-> 17ms

This should also help mitigate issues like
https://github.com/flutter/flutter/issues/24782
2019-02-04 14:56:13 -08:00
liyuqian
b6888b482e DCHECK that clip layer's behavior isn't none (flutter/engine#7659)
This will further guard that the framework won't forget to set the
clip behavior.

This has been tested with the flutter/flutter framework
`flutter test --local-engine=host_debug_unopt`
to ensure a successful engine roll.
2019-02-04 13:31:21 -08:00
liyuqian
13d75a0e8d Retained rendering in Fuchsia PhysicalShapeLayer (flutter/engine#6558)
For flutter/flutter#23535

When this lands/rolls into Fuchsia, a manual roll with https://fuchsia-review.googlesource.com/c/topaz/+/241557 is needed.
2019-02-04 13:31:10 -08:00
liyuqian
7626d22298 Fix typos in Fuchsia (flutter/engine#7563) 2019-01-23 13:27:51 -08:00
Brian Osman
3dd1198f0d Remove SkColorSpaceXformCanvas, use color-managed SkSurfaces instead (flutter/engine#7548)
Behavior (visual) changes should be very minor. Things that are to be expected:
* A few things were not color managed correctly by the transform canvas (color emoji, some color filters). Those will be handled correctly with the tagged surfaces (although we're always transforming to sRGB, so nothing should change until we target a wider gamut).
* Image filtering will happen in the source color space, rather than the destination. Very minor.
* The transform canvas did caching of images in the destination color space. Now, the conversion happens at draw time. If there are performance issues, images can be pre-converted to the destination with makeColorSpace().
2019-01-22 15:34:51 -05:00
liyuqian
d8224bff56 Fix suspicious typo "painted" to "paint" (flutter/engine#7530)
Since it's adding to paint_layers_, I think the "painted" is a typo of
"paint". It's also a misleading typo which mistakenly let people believe
that the layer has already been painted.
2019-01-18 13:44:30 -08:00
liyuqian
1333bde411 Remove unused headers (flutter/engine#7511) 2019-01-17 07:18:43 +08:00
liyuqian
a4bf143f24 Avg ms/frame instead of FPS in performance overlay (flutter/engine#7443)
Computing FPS from max ms/frame is misleading and we're no longer
just using 60 FPS displays.
2019-01-15 07:16:24 +08:00
reed-at-google
ba11d70840 update site to use SkFont for text fields (flutter/engine#7464) 2019-01-14 11:22:58 -05:00
Jason Simmons
2cc1104dd0 Use anti-aliasing when drawing text in the performance overlay (flutter/engine#7445)
The engine dropped the ability to draw non anti-aliased text in
a10b062df0

Fixes https://github.com/flutter/flutter/issues/26387
2019-01-10 15:28:48 -08: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
Brian Salomon
8d1c545b53 Remove unnecessary includes of Ganesh headers (flutter/engine#7189) 2018-12-12 10:58:14 -05:00
liyuqian
966eadadae Clear layer cache in RasterCache::Clear (flutter/engine#6915)
This fixes https://github.com/flutter/flutter/issues/24216
2018-11-20 16:48:13 -08:00
Michael Goderbauer
082336e7c2 Fix code smells reported by chrome's clang plugin (flutter/engine#6833) 2018-11-12 19:59:29 -08:00
liyuqian
a8aa99c094 Respect offset in OpacityLayer's paint bounds (flutter/engine#6826)
This fixes https://github.com/flutter/flutter/issues/23890

I'll add unit tests to flutter/flutter shortly.
2018-11-12 12:52:18 -08:00
Amir Hardon
3f3ce50597 Use the internal_nodes_canvas for all leaf node operations. (flutter/engine#6804)
This also renames the PaintContext's canvas to lead_nodes_canvas so that it
is more explicit on the call sites which canvas is being used.
2018-11-09 12:10:29 -08:00
Amir Hardon
e818420245 Synchronize Flutter's rendering with CA. (flutter/engine#6807)
Right now we do it whenever the platform views preview flag is on.
This is less efficient, filed
https://github.com/flutter/flutter/issues/24133 to only do this when
there's a platform view in the tree.
2018-11-09 12:10:09 -08:00
Amir Hardon
bfc1db2612 Support platform view overlays with GL rendering (flutter/engine#6769)
Moved the frame buffer specific logic from IOSGLContext to IOSGLRenderTarget.

use recording canvases for overlays

Support platform view overlays with gl rendering.

This also changes the overlay canvases (for both software and gl
rendering) be recording canvases, and only rasterize them after
finishing the paint traversal.
2018-11-08 19:52:43 -08:00
Amir Hardon
271e82a7e4 Include vector in embedded_views.h (flutter/engine#6800) 2018-11-08 12:54:36 -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
Mehmet Fidanboylu
e8d852bac0 Skia Cleanup (flutter/engine#6786) 2018-11-07 15:29:52 -08:00
Michael Goderbauer
0def82ddb0 Unify copyright lines (flutter/engine#6757) 2018-11-07 12:24:35 -08:00
Amir Hardon
9ff80d12a2 Add an Info.plist flag to enable the embedded iOS views preview. (flutter/engine#6756)
When the flag is true, we currently use a single thread configuration,
and disabled the raster cache for opacity layers.

The flag's name is 'io.flutter_embedded_views_preview'.
2018-11-05 20:08:25 -08:00
Amir Hardon
a9a5c333dc Update scene_update_context to match recent PaintContext changes. (flutter/engine#6736)
This fixes a Fuchsia build breakage cause by #6726 and #6603.
2018-11-02 13:55:24 -07: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