412 Commits

Author SHA1 Message Date
liyuqian
a7a25d3b57
Revert again "Remove layer integral offset snapping" (#18132) 2020-05-04 16:39:03 -07:00
liyuqian
4e2973633d
Reland "Remove layer integral offset snapping" (#17915)
This reverts commit b5aedb3 and relands #17712.

Fixes flutter/flutter#53288 and flutter/flutter#41654.

Together with #17791, this reland addresses some of Jim's concerns in the original PR #17712.

The major part of this PR is still the same as the original PR, and the performance / golden image impacts should be the same.
2020-05-01 15:01:42 -07:00
liyuqian
af19ea7b8d
Replace RasterCache::Get with RasterCache:Draw (#17791)
This avoids the possible matrix mismatch between RasterCache::Get and
RasterCacheResult::draw. See
https://github.com/flutter/engine/pull/17790 for an example that tries
to fix an earlier mismatch.
2020-04-23 12:12:06 -07:00
Emmanuel Garcia
b1c51cfe78
Extend external view embedder on Android (#17839) 2020-04-21 19:14:38 -07:00
liyuqian
b5aedb30fa
Revert "Remove layer integral offset snapping (#17712)" (#17785)
This reverts commit 99f8d007aaefcf2cb0a0a40c0b3c6a6fd7556f5c.

I found some problems. Will revise and reland later, and put more details about the problems in the new PR.

TBR: @chinmaygarde @flar
2020-04-17 08:26:22 -07:00
liyuqian
99f8d007aa
Remove layer integral offset snapping (#17712)
This fixes https://github.com/flutter/flutter/issues/53288 and https://github.com/flutter/flutter/issues/41654. It removes the problematic `GetIntegralTransCTM`, but preserves the rect round-out in `RasterCacheResult::draw` for performance considerations: the average frame raster time doesn't change much but the worst frame raster time significantly regressed if rect round-out is removed. That's probably because a new shader needs to be compiled to draw raster cache with fractional offsets.
2020-04-16 15:41:07 -07:00
Brian Osman
ef161fb5c1
Convert MatrixDecomposition from SkMatrix44 to SkM44 (#17760)
* Convert MatrixDecomposition from SkMatrix44 to SkM44

SkMatrix44 is deprecated and being removed.
2020-04-16 15:27:41 -04:00
Chris Yang
68fd833488
Reland "Improve iOS PlatformViews to better handle thread merging. #16935" (#17609) 2020-04-10 13:25:02 -07:00
Chris Yang
caebc93e0c
Revert "Improve iOS PlatformViews to better handle thread merging. (#16935)" (#17600)
This reverts commit f6b8eda714680e308a801d15829a5f71abee75d1.
2020-04-08 21:15:38 -07:00
Chris Yang
f6b8eda714
Improve iOS PlatformViews to better handle thread merging. (#16935) 2020-04-08 17:33:33 -07:00
Dan Field
ff62dec5c9
Roll to clang11, mark 4 (#17483)
* "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 4 (#17467)" (#17482)"

This reverts commit 8166a91bca11b83c16fba8f8fd407e937a2ac89c.

* format code

* Roll buildroot to 3a27de1c5bb0f50be7d3efe3e00de4f6068c9f30
2020-04-02 13:04:49 -07:00
Dan Field
8166a91bca
Revert "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 3 (#17467)" (#17482)
This reverts commit 39b77188c5425925a72fe0a64d246dbc0b3cdadc.
2020-04-02 10:01:26 -07:00
Dan Field
39b77188c5
Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 3 (#17467)
* Reland Clang 11, Roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c (#17457)" (#17464)

This reverts commit 9eacd028cdba5c6efef327342dc53fab61474462.

* Skip more image tests, use newer dsymutil, add missing symbols
2020-04-01 20:55:27 -07:00
mikejurka
1a437ac083
[fuchsia] Add tests for TransformLayer. (#17439) 2020-04-01 20:01:52 -07:00
George Wright
a3f82ad812 Flush the session after updating the scene 2020-04-01 19:48:07 -07:00
Dan Field
9eacd028cd
Revert "Reland Clang 11, Roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c (#17457)" (#17464)
This reverts commit a4026cc9f16a93fbce6c94af3ddaf971d363c195.
2020-04-01 17:50:57 -07:00
Dan Field
a4026cc9f1
Reland Clang 11, Roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c (#17457)
* Reland "Roll Clang to v11, roll buildroot to fe13f79dce4ce9aab3209f11988d825dcf580b4a, allow newly exported symbols (#17440)" (#17451)"

This reverts commit a870bc533c5bce9526563c3d2f40370e450b85f6.

* skip golden that is different on macos

* buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c
2020-04-01 16:32:13 -07:00
mikejurka
ee274fc61c
[fuchsia] Fix bug when applying scale. (#17436)
We were always scaling z by 0, instead of 1. This
caused the z elevation of some layers to be 0,
which was incorrect.
2020-03-31 21:49:44 -07:00
mikejurka
5cec47786f
[fuchsia] Re-enable shadows. (#17380)
Now that client apps use the same elevations on
Fuchsia and other platforms, shadows should look
identical.
2020-03-31 18:07:12 -07:00
liyuqian
807ca8543c
More rename from GPU thread to raster thread (#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
Emmanuel Garcia
b716cbba71
Reland unobstructed platform views (#17336) 2020-03-27 16:39:29 -07:00
liyuqian
b3075b3091
Rename GPU thread to raster thread in code comments (#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
Emmanuel Garcia
b235233e9d
Revert unobstructed platform views (#17326) 2020-03-25 14:36:10 -07:00
Jason Simmons
f1008d9bf9
Allow drawing raster cache results whose device rect is one pixel larger than the cached image (#17278)
RasterCacheResult::draw constructs the device target rectangle by
calling SkRect::roundOut, which rounds down the left/top coordinates
and rounds up the right/bottom coordinates.  The rounding can produce
a device rect whose width and/or height differs from the cache result
image's width/height by one pixel.
2020-03-25 13:37:27 -07:00
Kaushik Iska
f1d8026637
[metrics] Record the frame target time on the layer tree (#17281)
This lets us measure stats on when the frame was
scheduled to be rendered vs when it finished rasterizing.

Note: This isn't propagated to the FrameTimings struct yet,
that is to be followed.
2020-03-24 22:00:21 -07:00
liyuqian
945967054b
Rename GPU to raster thread in PerformanceOverlay (#17148)
Rename GPU to raster thread in PerformanceOverlay and update goldens.
2020-03-24 21:43:16 -07:00
Chinmay Garde
518c9e09cc
Remove checks for the always true using_fuchsia_sdk flag in all GN files. (#17261) 2020-03-23 18:31:02 -07:00
mikejurka
ad8ccf47b1
[Fuchsia] Move physical shape layer compositing to Flutter (#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
Chinmay Garde
e56b335ade
Allow external texture sources when using the Metal backend. (#17154) 2020-03-22 22:36:03 -07:00
Emmanuel Garcia
f5d25da83c
Reland: Implement unobstructed Platform Views on iOS (#17237) 2020-03-20 18:58:55 -07:00
Emmanuel Garcia
70f6d18bfa
Revert "Implement unobstructed Platform Views on iOS (#17049)" (#17233)
This reverts commit 2627634be807a28f4d56c5d7cd878c3ff6ce07ac.
2020-03-20 14:46:09 -07:00
Emmanuel Garcia
2627634be8
Implement unobstructed Platform Views on iOS (#17049) 2020-03-20 12:38:58 -07:00
Jim Graham
e48761e5bb
Reland ImageFiltered bounds fix (#17077)
Fix for https://github.com/flutter/flutter/issues/51978 to use the bounds of the filtered result as the layer's paint bounds.
2020-03-13 14:44:27 -07:00
Chinmay Garde
a37560a074
Use the standard [[nodiscard]] attribute instead of an FML macro. (#17100) 2020-03-11 13:36:01 -07:00
Chinmay Garde
17e07c537e
Implement asynchronous texture uploads when using the Metal backend on iOS. (#17046)
This moves the Metal `GrContext` creation utilities from `GPUSurfaceMetal` into
a separate `IOSContext` object subclass. An analogue of this object was used in
the GL regime for the management of onscreen and offscreen contexts that were
not tied to the lifecycle of the `GPUSurface`. This pattern has now been
generalized for use with all backends that need a resource context
(`IOSContextGL` and `IOContextMetal`).

The platform views controller management in the `ExternalViewEmbedder` interface
implementation was repeated three times for [Metal][metal], [OpenGL](opengl) and
[Software](software) rendering. This repetition has been removed and a single
implementation present in the base `IOSSurface` and used on all platforms.
Addition of new client rendering APIs should not affect how the engine renders
into the platform view interleaving levels.

All rendering API selection logic has been moved into a single set of utilities
in `rendering_api_selection.h`. This enables the removal of a lot of code blocks
guarded by `FLUTTER_SHELL_ENABLE_METAL`. The remaining uses of this will be
removed when unified builds are enabled.

The Metal backend now also adds traces similar to the GL backend.

The `IOGLContext` has been renamed to `IOContextGL` to be more in line with the
convention used in this library.

Fixes https://github.com/flutter/flutter/issues/41827
Adds https://github.com/flutter/flutter/issues/52150

[metal]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_metal.mm (L55)
[opengl]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_gl.mm (L95)
[software]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_software.mm (L146)
2020-03-10 16:01:53 -07:00
Emmanuel Garcia
d884e27a68
Add RTree to flow (#16923) 2020-03-10 15:47:17 -07:00
Jim Graham
220039a9c8
Revert "Fix bounds of image_filter_layer (#16960)" (#17074)
This reverts commit 8b6119ec8367bbe3de52fd5f40737219be8d5b8b.
2020-03-10 14:09:10 -07:00
Jim Graham
8b6119ec83
Fix bounds of image_filter_layer (#16960) 2020-03-09 13:58:44 -07:00
Chris Bracken
df942131b8
Revert "Try rasterizing images and layers only once , even when their rasterization fails. Further enforce the same access threshold on layers as on Pictures. Previously layers would always be cached. The latter is a semantic change. (#16545)" (#16889)
This caused regression in several benchmarks, including:
animated_placeholder_perf. Regression tracked in
https://github.com/flutter/flutter/issues/51776.

This reverts commit 01a52b9947054f57398f2aaa2b59e7d501506580.
2020-03-02 11:44:45 -08:00
Sebastian Jeltsch
01a52b9947
Try rasterizing images and layers only once, even when their rasterization fails. Further enforce the same access threshold on layers as on Pictures. Previously layers would always be cached. The latter is a semantic change. (#16545)
If Rasterization fails, i.e. image.is_valid() is false, the cache might try rasterizing the image again on the next frame. Not only is this wasteful put might also prevent other pictures to be cached within the current frame budget.
2020-02-28 12:13:22 -08:00
Sebastian Jeltsch
80be2c43ea
Fix RasterCache LRU logic, opportunistic simplifications. (#16434)
RasterCache::Get() methods were not updating the RasterCache::Entry
access_count and used_this_frame fields, as is done in
RasterCache::Prepare(). This can result in onscreen images being evicted
from the cache as new entries are created (e.g. as new elements scroll
onscreen).
2020-02-06 13:15:51 -08:00
Chinmay Garde
f44f50f3c5
Fix race in SkiaGPUObject unit-tests. (#16351)
There are two issues in the test as written:
* There is a race on the first check to dtor_task_queue_id which might be
  encountered if the calling thread is de-scheduled and the unref queue manages
  to collect the object before the end of the scope.
* Two threads were owning a shared object but we relied on the object to be
  collected on the unref queue.
2020-02-03 19:57:43 -08:00
Chinmay Garde
f7b78e001d
Remove all uses of the redundant flutter_root variable. (#16311)
This was only necessary when the Engine had to build in multiple buildroots
where the sources where checked out at different paths relative to the
buildroot. This is no longer the case and there are already cases GN rules
have been written that mix and match variable usage with the direct
specification of the path to the Flutter sources relative to the sole buildroot.
2020-01-31 21:49:48 -08:00
Dan Field
89f3471fa7
the the fix (#15973) 2020-01-24 12:43:32 -08:00
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
Jim Graham
929b1edff5
Engine support for ImageFiltered widget (#14491)
web_ui support coming in https://github.com/flutter/flutter/issues/47163
2019-12-19 16:47:08 -08:00
mikejurka
1f7bb9d0c1
Wire up OpacityLayer to Scenic (#14577)
A previous version of this change also removed
system compositing of PhysicalShapeLayers on
Fuchsia. In this reland, keep using system
composting for PhysicalShapeLayers.

Co-authored-by: David Worsham <arbreng@gmail.com>
2019-12-19 23:25:43 +01:00
Kaushik Iska
f2dbeb8aa7
Reland Wire up Opacity on Fuchsia (#14559)
This reverts commit 6ea69a0d4339dd153899bb6c299689f1dd43329d.

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
6ea69a0d43
Revert "Wire up Opacity on Fuchsia, round 2 (#14024)" (#14543)
This reverts commit d117ac979c28363a0a6b02d4a54945212a88b6f9.
2019-12-18 10:29:47 -08:00
Jim Graham
85953615eb
Conditionally use offscreen root surface only when needed
Currently helps primarily on iOS when no BackdropFilter is present by lowering energy usage
2019-12-11 15:10:55 -08:00