111 Commits

Author SHA1 Message Date
Michael Reed
7ef5d67e1b Use sampling instead of (deprecated) filter-quality (flutter/engine#24101) 2021-02-01 00:16:02 -08:00
Jim Graham
b4a85a26ca Request quickReject results from correct drawing canvas (flutter/engine#22674)
Also Fix MockCanvas clipping so tests will work with new culling
2020-11-24 13:11:15 -08:00
Jim Graham
949d20ee2e Move layer clip culling to Paint() method to fix child caching (flutter/engine#22336) 2020-11-13 15:23:03 -08:00
Dan Field
d9bd7aff97 set old_gen_heap_size to half of available memory on iOS (flutter/engine#20472) 2020-09-18 12:32:02 -07:00
Dan Field
35d014eee7 Revert hint_freed (flutter/engine#20746)
This caused over-aggressive GCs, which vastly increased CPU usage benchmarks.

* Revert "fix build (#20644)"

This reverts commit 5e03f90cdd9392f95b47d08b398c18cab6d16b12.

* Revert "Hint freed (#19842)"

This reverts commit 73490a2ca444c8ca491712cde21a459453af8795.
2020-08-25 11:55:40 -07:00
Dan Field
73490a2ca4 Hint freed (flutter/engine#19842)
* Hint the VM when a layer or picture goes out of scope
2020-08-19 14:04:31 -07:00
David Worsham
ad2bff1014 Reland: "fuchsia: Remove dead code / break dependencies" (flutter/engine#20532)
Reland #19396 with a fix for improper scale that was affecting internal tests

Tested: Ran all unittests, ran internal tests, and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-14 20:41:18 -07:00
Yuqian Li
4dec444c69 Add a service protocol for raster cache memory (flutter/engine#20466)
Related issue: https://github.com/flutter/flutter/issues/56719
2020-08-13 20:11:47 -07:00
Zachary Anderson
275f2b04cc Revert "fuchsia: Remove dead code / break dependencies (#19396)" (flutter/engine#20302)
This reverts commit 017f07942e8e80a4e886def19c6fffac7ce18479.
2020-08-06 12:06:06 -07:00
David Worsham
017f07942e fuchsia: Remove dead code / break dependencies (flutter/engine#19396)
The fuchsia code around metrics and sizing was just sending this
information through a side-channel, when the engine already had the
information available. So, delete all of it to make future CLs simpler.

Additionally, the SceneUpdateContext has many unneccesary dependencies
re: metrics and PaintTasks. Break those to make future CLs simpler.

Tested: Ran all unittests and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-03 22:09:26 -07:00
Zachary Anderson
b7b32e51b4 Enable linting in several files (flutter/engine#20134) 2020-07-31 21:28:36 -07:00
Adlai Holler
e5614964f4 Use the GrDirectContext factories instead of deprecated GrContext ones (flutter/engine#19962)
This is part of a larger effort to expose the difference between GrDirectContext,
which runs on the GPU thread and can directly perform operations like uploading
textures, and GrRecordingContext, which can only queue up work to be delivered
to the GrDirectContext later.
2020-07-28 13:32:09 -07:00
gaaclarke
ee0e1788d9 Made the linter print out more information in its output and fixed bugs (flutter/engine#19895) 2020-07-22 15:38:09 -07:00
Brian Osman
56b4fdf9e0 Add missing GrContext.h include (flutter/engine#19528)
This is an IWYU change that unblocks some Skia API shuffling.
2020-07-06 16:53:23 -04:00
Jim Graham
3953882fbb Fix child caching in opacity_layer (flutter/engine#17914)
Choose a child more likely to remain stable from frame to frame as the target to cache in the OpacityLayer.
2020-05-28 18:45:43 -07:00
liyuqian
452b98622a Replace RasterCache::Get with RasterCache:Draw (flutter/engine#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
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
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
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
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
gaaclarke
43dce83fc1 Refactor to passing functions by const ref (flutter/engine#13975)
Moved our code to passing functions by const ref
2019-11-22 12:20:02 -08:00
liyuqian
b9f2bacea8 Fix picture raster cache throttling (flutter/engine#13710)
Previously, we're also counting the pictures that are already raster
cached.

This fixes https://github.com/flutter/flutter/issues/44252 and helps
solving the GPU thread issue of https://github.com/flutter/flutter/issues/43083

https://github.com/flutter/flutter/pull/45050 is a performance test in the framework repo to reveal this bug.
2019-11-20 16:36:23 -08:00
Michael Klimushyn
24ba26f80c Turn on RasterCache based on view hierarchy (flutter/engine#13762)
This is a duplicate of flutter/engine#13360 with the test switched to use the software backend instead of the GL backend.

After some debugging and testing on another GL embedder I think the issue with the test is some bug having to do with the GL implementation in the test harness specifically. 

Fixes flutter/flutter#38903
2019-11-08 17:14:50 -08:00
Dan Field
5ac5df1fdd Fix mDNS for iOS13 (flutter/engine#13451) 2019-11-01 15:29:15 -07:00
Michael Klimushyn
791c5441a5 Revert "Turn on RasterCache based on view hierarchy (#13360)" (flutter/engine#13442)
This caused EmbedderTest.VerifyB143464703 to fail after merging into
master.

```
../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:3111: Failure
Value of: ImageMatchesFixture("verifyb143464703.png", renderered_scene)
  Actual: false
Expected: true
[  FAILED  ] EmbedderTest.VerifyB143464703 (2507 ms)
```

This reverts commit b1479f8e6075ef95d6b11a03e318bff72a2c0288.
2019-10-30 11:25:29 -07:00
Michael Klimushyn
b1479f8e60 Turn on RasterCache based on view hierarchy (flutter/engine#13360)
Previously the cache was disabled on whether or not PlatformViews were
globally enabled. Instead track their existence in the view hierarchy
and only disable RasterCache if a PlatformView is actually present.
2019-10-30 10:45:15 -07:00
liyuqian
2778d3bb20 Revert "[fuchsia] Wire up OpacityLayer to Scenic (#11322)" (flutter/engine#12610)
This reverts commit 639cc113f0b2ccf9fcf69ded7960d41d0b611f80.

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
Jonah Williams
c341326d6a Add support for JIT release mode (flutter/engine#12446) 2019-09-27 11:20:54 -07:00
David Worsham
639cc113f0 [fuchsia] Wire up OpacityLayer to Scenic (flutter/engine#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
liyuqian
e099414b49 Trace RasterCacheResult::Draw (flutter/engine#11004)
Fixes https://github.com/flutter/flutter/issues/37988
2019-08-14 16:13:49 -07:00
Chris Yang
cec3b15298 Move the mutators stack handling to preroll (flutter/engine#9651)
* refactoring to move the mutator stack handling to preroll

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

This reverts commit 52ceaee505a26b6bad893e38b33c522d1e0ba571.

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

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
5625d01b32 IOS Platform view transform/clipping (flutter/engine#9075) 2019-06-25 09:33:50 -07:00
Zachary Anderson
35107c4dca Revert tracing changes (flutter/engine#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit e7d406fe36790b1a8161d4687a6a4a144ba44254.

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

This reverts commit 1ccb372e5f8ceaaf90f5b43b42df617d7f18d955.
2019-06-12 10:25:49 -07:00
Dan Field
1ccb372e5f Align fuchsia and non-fuchsia tracing (flutter/engine#9199) 2019-06-05 15:14:27 -07:00
liyuqian
b000f9830c Rename frame_time and engine_time (flutter/engine#8952)
At a quick glance, one could easily think of the "engine_time" as the
GPU thread time and the "frame_time" as the UI thread time because the
GPU thread time is mainly spent on the engine while the UI thread time
is mainly spent on the Dart framework to generate the frame.

But it's actually the other way. The "engine_time" is UI thread time and
the "frame_time" is the GPU thread time.

To avoid the confusion, rename them to "ui_time" and "raster_time"
respectively. I avoided the "gpu_time" because the rasterization may be
purely on a CPU backed software Skia backend.
2019-05-14 14:29:27 -07:00
liyuqian
452e630ee2 Generate layer unique id for raster cache key (flutter/engine#8637)
The raw pointer isn't a reliable id as the allocator can reuse an
address that's just been released for another layer.

This will fix Fuchsia bug FL-216.

This problem was not affecting non-Fuchsia Flutter probably because
non-Fuchsia Flutter purges the raster cache key much more frequently so
we won't see a key collision. In Fuchsia, as the key has to wait for the
Vulkan surface to render asynchronously, this suddenly becomes an issue.
2019-04-18 14:14:06 -07:00
liyuqian
27e4dac06b Rename flow namespace to flutter (flutter/engine#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
Qxyat
500f19660d Composite Embedded Views with the correct GrContext
PaintRecorder Canvases are not associated with GrContexts.
2019-04-16 14:13:34 -07:00
liyuqian
dedfd60b46 Rename threshold to access_threshold (flutter/engine#8354) 2019-03-28 14:37:00 -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
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
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
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
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