402 Commits

Author SHA1 Message Date
Dan Field
904a84fee3 Roll to clang11, mark 4 (flutter/engine#17483)
* "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 4 (#17467)" (#17482)"

This reverts commit d7bbf2e70c8cb86823f1ec7a310d6ab0b9a610db.

* format code

* Roll buildroot to 3a27de1c5bb0f50be7d3efe3e00de4f6068c9f30
2020-04-02 13:04:49 -07:00
Dan Field
d7bbf2e70c Revert "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 3 (#17467)" (flutter/engine#17482)
This reverts commit 31eab31f771363d9c4fc9799449859abe0e464f2.
2020-04-02 10:01:26 -07:00
Dan Field
31eab31f77 Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 3 (flutter/engine#17467)
* Reland Clang 11, Roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c (#17457)" (#17464)

This reverts commit 6083cda709c194ec81d2092c70a0151a10f0c922.

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

This reverts commit d77d53688f77285966adeb2a24349ba490a7e6ce.

* skip golden that is different on macos

* buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c
2020-04-01 16:32:13 -07:00
mikejurka
f434b2e6a8 [fuchsia] Fix bug when applying scale. (flutter/engine#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
9a7303b7ad [fuchsia] Re-enable shadows. (flutter/engine#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
b5318d05ff More rename from GPU thread to raster thread (flutter/engine#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
2656509ba5 Reland unobstructed platform views (flutter/engine#17336) 2020-03-27 16:39:29 -07:00
liyuqian
10824995dd Rename GPU thread to raster thread in code comments (flutter/engine#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
2913102440 Revert unobstructed platform views (flutter/engine#17326) 2020-03-25 14:36:10 -07:00
Jason Simmons
c2e581b781 Allow drawing raster cache results whose device rect is one pixel larger than the cached image (flutter/engine#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
60f620b4b2 [metrics] Record the frame target time on the layer tree (flutter/engine#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
a7073893f4 Rename GPU to raster thread in PerformanceOverlay (flutter/engine#17148)
Rename GPU to raster thread in PerformanceOverlay and update goldens.
2020-03-24 21:43:16 -07:00
Chinmay Garde
929fb3f825 Remove checks for the always true using_fuchsia_sdk flag in all GN files. (flutter/engine#17261) 2020-03-23 18:31:02 -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
Chinmay Garde
44f93dddb7 Allow external texture sources when using the Metal backend. (flutter/engine#17154) 2020-03-22 22:36:03 -07:00
Emmanuel Garcia
fa2f49dbcb Reland: Implement unobstructed Platform Views on iOS (flutter/engine#17237) 2020-03-20 18:58:55 -07:00
Emmanuel Garcia
3c04f343d3 Revert "Implement unobstructed Platform Views on iOS (#17049)" (flutter/engine#17233)
This reverts commit a1f7b10dfac894be08bd6e8fa2a65063cb8b5277.
2020-03-20 14:46:09 -07:00
Emmanuel Garcia
a1f7b10dfa Implement unobstructed Platform Views on iOS (flutter/engine#17049) 2020-03-20 12:38:58 -07:00
Jim Graham
61cfe07919 Reland ImageFiltered bounds fix (flutter/engine#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
8f5f888826 Use the standard [[nodiscard]] attribute instead of an FML macro. (flutter/engine#17100) 2020-03-11 13:36:01 -07:00
Chinmay Garde
6349c95def Implement asynchronous texture uploads when using the Metal backend on iOS. (flutter/engine#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]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_metal.mm (L55)
[opengl]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_gl.mm (L95)
[software]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_software.mm (L146)
2020-03-10 16:01:53 -07:00
Emmanuel Garcia
66e6a6de18 Add RTree to flow (flutter/engine#16923) 2020-03-10 15:47:17 -07:00
Jim Graham
4298c81041 Revert "Fix bounds of image_filter_layer (#16960)" (flutter/engine#17074)
This reverts commit 5f527ac3b3e91c15082cac9bb191fa4f2aa83fae.
2020-03-10 14:09:10 -07:00
Jim Graham
5f527ac3b3 Fix bounds of image_filter_layer (flutter/engine#16960) 2020-03-09 13:58:44 -07:00
Chris Bracken
88d9a5f43c 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)" (flutter/engine#16889)
This caused regression in several benchmarks, including:
animated_placeholder_perf. Regression tracked in
https://github.com/flutter/flutter/issues/51776.

This reverts commit ac4e9832c910a031bf2dfb36605edbc834397c2b.
2020-03-02 11:44:45 -08:00
Sebastian Jeltsch
ac4e9832c9 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. (flutter/engine#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
e7e1637bd9 Fix RasterCache LRU logic, opportunistic simplifications. (flutter/engine#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
c243987f16 Fix race in SkiaGPUObject unit-tests. (flutter/engine#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
426c48aaac Remove all uses of the redundant flutter_root variable. (flutter/engine#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
62a99c60c5 the the fix (flutter/engine#15973) 2020-01-24 12:43:32 -08: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
Jim Graham
77b9134e96 Engine support for ImageFiltered widget (flutter/engine#14491)
web_ui support coming in https://github.com/flutter/flutter/issues/47163
2019-12-19 16:47:08 -08:00
mikejurka
36839c42a7 Wire up OpacityLayer to Scenic (flutter/engine#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
76d887b711 Reland Wire up Opacity on Fuchsia (flutter/engine#14559)
This reverts commit 6919709e47661c5cd48d9b0d3bfde986b9c1af84.

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
6919709e47 Revert "Wire up Opacity on Fuchsia, round 2 (#14024)" (flutter/engine#14543)
This reverts commit cb0aca7f74a34a6a79f6b7123bd0643a135cf56a.
2019-12-18 10:29:47 -08:00
Jim Graham
17e3cf8e55 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
liyuqian
d067c4a259 Cleanup the IO thread GrContext (flutter/engine#14265)
Fixes https://github.com/flutter/flutter/issues/19558

This is tested by the devicelab test fast_scroll_large_images__memory
2019-12-10 16:02:02 -08:00
Jason Simmons
9a8367da7e Do not paint a layer's children if the children were not prerolled (flutter/engine#14149)
Prerolling a layer can have side effects.  In particular, PlatformViewLayer::Preroll
will call view_embedder->PrerollCompositeEmbeddedView.

Clip layers will check whether the layer's children are all clipped and if so
will skip calling Preroll on the children.  However, the Paint implementation in
these layers was always calling Paint on their children.

This could result in a call to PlatformViewLayer::Paint without a corresponding
call to PlatformViewLayer::Preroll.  This translates to a CompositeEmbeddedView
call without a PrerollCompositeEmbeddedView call on the affected view_id.
The EmbedderExternalViewEmbedder implementation does not allow that.

With this change, clip layers will only call PaintChildren if the preroll
called PrerollChildren.

See https://github.com/flutter/flutter/issues/46111
2019-12-05 16:25:55 -08:00
David Worsham
cb0aca7f74 Wire up Opacity on Fuchsia, round 2 (flutter/engine#14024)
* Remove erroneous ChildView opacity

* Wire frame metrics through contexts

* Maintain layer stack inside of SceneBuilder

* Remove EnsureSingleChild

* Centralize system-composite and elevation logic

* Wire up OpacityLayer to Scenic
2019-12-04 19:29:31 -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
Jim Graham
a13401ce86 Dynamically determine whether to use offscreen surface based on need (flutter/engine#13976)
Only use an offscreen surface on iOS if a layer which reads back from the destination surface, such as BackdropFilter, is present.
2019-11-27 15:01:25 -08:00
Chinmay Garde
dee0c26a36 Don't crash but warn when the scene builder specifies no layers. (flutter/engine#14008) 2019-11-25 15:38:41 -08:00
Kaushik Iska
e04a911e5c [fuchsia] Capture SkRRect in scene_update_context by value (flutter/engine#13989)
This was leading to usage of the captured rect after the end
of the lifetime in descrutor of Frame.
2019-11-22 16:29:58 -08:00
gaaclarke
ec5cf813f6 Made a way to turn off the OpenGL operations on the IO thread for backgrounded apps (flutter/engine#13908) 2019-11-22 14:08:33 -08:00