210 Commits

Author SHA1 Message Date
liyuqian
e79d77f6e6
Add offset to engine OpacityLayer (#6594)
See https://github.com/flutter/flutter/pull/22566#discussion_r226082171
for why we add this.
2018-10-19 11:46:12 -07:00
Amir Hardon
a1bbea77cf
Add a no-op platform view layer. (#6505)
This will be used for embedding UIViews on iOS.

Landing a no-op layer as a first incremental step to keep PRs small.
2018-10-12 19:40:21 -07:00
liyuqian
e44c10c962
Reland "Share engine layers with the framework" (#6412) (#6468)
This reverts commit 74662ab695238af0e7402f41c4bf9ad862bd37d2.

This should land after https://github.com/flutter/engine/pull/6442

* Add pragma vm:entry-point

Otherwise, an object may be both null and an instance of EnginieLayer at
the same time in Dart.
2018-10-12 07:45:42 -07:00
liyuqian
daf4447a2e
Reland "Allow raster caching any layer subtree (#6442)" (#6507)
* Revert "Revert "Allow raster caching any layer subtree (#6442)" (#6506)"

This reverts commit c6e6da512a54c1bb33a584b117bcf300ce71b166.

* Use raw pointer for RasterCacheKey

So we won't depend on whether it's a std::unique_ptr or std::shared_ptr.
2018-10-11 15:09:09 -07:00
liyuqian
c6e6da512a
Revert "Allow raster caching any layer subtree (#6442)" (#6506)
Reverts flutter/engine#6442

container_layer.h file is not synced which broke the bots
2018-10-11 14:18:22 -07:00
liyuqian
6447418f76
Allow raster caching any layer subtree (#6442)
We first test this with OpacityLayer. This test alone (without retained rendering) should have ~30% speedup as we'll have fewer render target switches by snapshoting in the Preroll instead of saveLayer in the Paint.

In my local flutter_gallery transition perf tests, the average frame time drops from ~16ms to ~12ms.

https://github.com/flutter/flutter/issues/21756
2018-10-11 13:24:33 -07:00
liyuqian
74662ab695
Revert "Share engine layers with the framework" (#6412)
Reverts flutter/engine#6406

We need to fix the SkiaGPUObject issue of the raster cache SkImage before merging this PR.
2018-10-02 16:51:47 -07:00
liyuqian
9ccc96625f
Share engine layers with the framework (#6406)
To make the PR minimal, we currently only share the engine layer when `pushPhysicalShape` (for Fuchsia) or `pushOffset` (for `RepaintBoundary` and `Opacity`) are called. They should be sufficient for our short-term perf goal. In the future, we can incrementally share more engine layers with the framework.

https://github.com/flutter/flutter/issues/21756
2018-10-02 14:02:10 -07:00
Mehmet Fidanboylu
a8890fdccd
SkImageFilter needs to be imported in the header (#6296) 2018-09-20 16:45:23 -07:00
Jason Simmons
ba7752917f
Ensure that Layer::AutoSaveLayer objects are not immediately destructed (#6264)
Fixes https://github.com/flutter/flutter/issues/20859
2018-09-17 11:43:41 -07:00
liyuqian
b43b3e8702
Remove LayerBuilder and DefaultLayerBuilder (#6256)
This essentially reverts https://github.com/flutter/engine/pull/4197/
as no one is (or soon will be) implementing an alternative LayerBuilder.
Let's just put everything in SceneBuilder to reduce the YAGNI
(you aren't gonna need it) smell. This will also make retained rendering
API changes much easier.
2018-09-14 15:13:00 -07:00
Gary Qian
838eb3d481
Improve performance of performance overlay by caching. (#6225)
Cache a SkSurface with previously drawn shapes so that we do not need to draw them again in future frames.

On Nexus 5X test device, old render time for just the overlay was 1.3ms-3.0ms and this version improves to 0.9ms-1.3ms running flutter gallery in profile mode.
2018-09-11 16:13:23 -07:00
liyuqian
7ac3345c65
Remove root_surface_transformation from PaintContext (#6213)
It should be sufficient to provide the matrix to preroll.
2018-09-11 15:29:08 -07:00
Gary Qian
93dac2a88d
Always save canvas and correctly pass antialias boolean in ClipRects. (#6199) 2018-09-07 14:02:39 -07:00
Eric
e164e83a85 Reset the raster cache when the compositor context is created. (#6150) 2018-09-06 17:11:17 -07:00
Zachary Anderson
bd7593b2ad
[fuchsia] Plumb root_surface_transformation in scene_update_context (#6187)
* [fuchsia] Plumb root_surface_transformation in scene_update_context

To fix the Fuchsia build.

* Update scene_update_context.cc
2018-09-06 12:35:12 -07:00
Gary Qian
aaf98fbfed
Use double multiplication by a scale instead of 3 divides for speed. (#6154) 2018-09-04 10:54:52 -07:00
Gary Qian
593ed59143
Revert "Use Skia normalize again after Skia precision fix. (#6121)" (#6122)
This reverts commit dc7b5eb89da31cddc2abc91aa5b30bcc6d66e70c.
2018-09-04 10:21:30 -07:00
Gary Qian
dc7b5eb89d
Use Skia normalize again after Skia precision fix. (#6121)
* Fix tilt by using custom normalize impl to avoid strange skia normalize behavior

* Use Skia normalize again after Skia fix.
2018-08-30 11:18:01 -07:00
Gary Qian
c765bee59d
Fix tilt by using custom normalize impl to avoid strange skia normalize behavior (#6106) 2018-08-29 10:36:35 -07:00
Chinmay Garde
47a1ce0e62
Allow embedders to set the root surface transformation. (#6085) 2018-08-28 14:13:49 -07:00
liyuqian
b3e866e8a4
Call drawPath without clip if possible (#5952)
It turns out that Skia is much slower at drawing paint inside a clipped
path than directly drawing that path. (Average frame time of 22ms vs
18ms in flutter_galary transition test.)
2018-08-07 14:47:32 -07:00
amirh
7e0bb3bbe8
Allow freezing a texture. (#5938)
This is needed to avoid jank when resizing an embedded Android view.
See
https://github.com/flutter/flutter/issues/19572#issuecomment-410400724
2018-08-07 14:43:19 -07:00
liyuqian
ecbb2b28d4
Call drawPaint instead of drawPath if there's clip (#5937)
If we want to avoid the bleeding edge artifact (flutter/flutter#18057 (comment)) using saveLayer, we have to call drawPaint instead of drawPath as anti-aliased drawPath will always have such artifacts.

This is discovered when I try to add golden tests for such bleeding artifacts using our new Clip enum. Here's the updated golden files: flutter/goldens@cb1fa8a?short_path=57b30ce#diff-57b30cea9b10b7ca689009854e12d70e
2018-08-03 17:00:00 -07:00
Chinmay Garde
33b412313e
Fix sundry Fuchsia build issues after the tonic/fxl migration. (#5920) 2018-08-01 13:29:45 -07:00
Chinmay Garde
9f8285ac6c
Remove all dependencies on Garnet. (#5869) 2018-07-26 12:49:34 -07:00
Chinmay Garde
336c23f846
Remove //flutter/glue and use FML directly. (#5862) 2018-07-25 13:20:48 -07:00
liyuqian
f50e218d99
Rename clip mode to clip behavior (#5853)
* Rename clip mode to clip behavior

So we're consistent across flutter/flutter and flutter/engine

* Clang format
2018-07-25 09:57:10 -07:00
Joshua Seaton
663b4925b8
[fml][fxl] Migrate AutoResetWaitableEvent to fml version. (#5808)
Thanks Jason for the speedy review
2018-07-20 10:12:38 -07:00
liyuqian
e1cf837a20
Add ClipMode to ClipPath/ClipRRect and PhysicalShape layers (#5647)
For flutter/flutter#18057
2018-07-13 12:38:16 -07:00
Jonah Williams
d217a95126
Remove cullRect calculation on TransformLayers with a perspective transform. (#5693) 2018-07-09 12:52:10 -07:00
Adam Barth
24af9ca6c3
[fuchsia] Update gn label for fuchsia.ui.scenic (#5673)
The gn label for this target changed.
2018-07-03 21:08:28 -07:00
mikejurka
2261ccf87e
[fuchsia] Update scenic lib path. (#5649) 2018-06-29 17:24:47 -07:00
mikejurka
4c4ef987a6
[fuchsia] Rename scenic_lib => scenic (#5648)
TEST=Compiled and ran flutter app on Fuchsia, verified it rendered and responded to input.
2018-06-29 17:06:55 -07:00
liyuqian
964569b7e7
Improve perf overlay performance. (#5571)
1. Mark perf overlay path as volatile
2. Set sample_margin_width = 0 to get a bar graph instead of saw-tooth.

Previously, the perf overlay itself could be a significant performance
hit and that makes it difficult to profile flutter app.
2018-06-19 16:42:21 -07:00
liyuqian
508884af7c
Call SkAutoCanvasRestore with doSave = true (#5432)
Although we do have a save before this SkAutoCanvasRestore so we
can theoretically send in doSave = false, it's safer to set doSave
to true to prevent future breakage.

As discussed with mtklein@google.com and reed@google.com, saving
canvas is very cheap in Skia so this should have no performance
impact. Skia is also considering remove doSave argument from
SkAutoCanvasRestore and always save the canvas.
2018-05-31 16:41:58 -07:00
cary-clark
89eb6a3745 call existing ostream operator for SkMatrix (#5427)
This permits removing the call to SkMatrix::toString(), which is deprecated.
2018-05-31 09:55:57 -04:00
liyuqian
d174c4ff01
Remove unnecessary saveLayer (#5420)
saveLayer is slow so we should avoid it as much as possible. If
there are artifacts without saveLayer, then we should report that
to Skia for the fix instead of slowing the performance with
saveLayer.

This PQ makes average rasterizer time drop from 25ms to 18ms in
flutter_gallery transitions perf test on a Nexus 5X.

This partially fixes flutter/flutter#13736 .
We probably still need some work in the opacity layer to squize
all the performance improvements.
2018-05-30 12:50:12 -07:00
liyuqian
1ef8cd2f11
Use drawImage for picture layer cache (#5315)
Fixes
1. https://github.com/flutter/flutter/issues/12148
2. most part of https://github.com/flutter/flutter/issues/17731 except some tiny AA diffs.
2018-05-23 16:53:20 -07:00
P.Y. Laligand
8f7a59b529
[fuchsia] Use the real name for the GFX library... (#5346) 2018-05-23 12:09:23 -07:00
P.Y. Laligand
8b0c5c1b99
[fuchsia] Updated references to the gfx FIDL library. (#5341) 2018-05-23 10:25:33 -07:00
cary-clark
537f8922c4 remove Skia toString() use (#5326)
Skia toString() is not maintained; the debugger that used it has been replaced. 
Replace usage with equivalent implementation.
2018-05-21 09:04:51 -04:00
Todd Volkert
1179c38a42
Clear the raster cache result when bypassing raster cache. (#5300)
https://github.com/flutter/flutter/issues/17448
2018-05-17 23:50:07 -07:00
cary-clark
f045500389 rename obsolete SkColor.h macro (#5175)
change SkColorSetARGBInline to SkColorSetARGB. SkColorSetARGBInline is deprecated and will be deleted from Skia.
2018-05-04 13:44:44 -04:00
Chinmay Garde
f1234eb077
Add disabled failing test for floating point errors on matrix decomposition. (#5076) 2018-04-24 16:02:38 -07:00
Chinmay Garde
8973c733a5
Implement Scene::toImage for creating a raster image representation of a scene. (#5021) 2018-04-18 12:42:16 -07:00
Chinmay Garde
58e84c8bf0
Re-land "Support multiple shells in a single process. (#4932)" (#4998)
* Re-land "Support multiple shells in a single process. (#4932)"

This reverts commit 723c7d01439da4261bc836075fb55651ce9e7f03.
2018-04-13 13:48:15 -07:00
Vyacheslav Egorov
723c7d0143
Revert "Re-land "Support multiple shells in a single process. (#4932)" (#4977)" (#4981)
This reverts commit a3327bff86800b3e654a2988fa7e6049edeb679c.
2018-04-12 18:28:55 +02:00
Chinmay Garde
a3327bff86
Re-land "Support multiple shells in a single process. (#4932)" (#4977)
This reverts commit 9199b40f2a2a6e448cd251de44e020ec3b75002d.
2018-04-11 15:41:23 -07:00
Chinmay Garde
9199b40f2a
Revert "Support multiple shells in a single process. (#4932)" (#4964)
This reverts commit 6baff4c821350bbcb64e7d029574b567f3801a1a.
2018-04-10 15:28:43 -07:00