Commit Graph

363 Commits

Author SHA1 Message Date
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
liyuqian 212fbbaf82 Cleanup the IO thread GrContext (#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 af511babc7 Do not paint a layer's children if the children were not prerolled (#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 d117ac979c Wire up Opacity on Fuchsia, round 2 (#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 2fc1e1bce1 Relanding: Add Flow unittests and fixtures (#14091) 2019-12-03 14:33:02 -08:00
liyuqian 84bf72917c Revert PRs to unblock David and Jim's work (#14088)
* Revert "Add flow test fixtures and tests (#13986)"

This reverts commit 620f5281b8.

* Revert "Dynamically determine whether to use offscreen surface based on need (#13976)"

This reverts commit a86ef94656.
2019-12-03 12:02:37 -08:00
David Worsham 620f5281b8 Add flow test fixtures and tests (#13986) 2019-12-03 09:43:02 -08:00
Jim Graham a86ef94656 Dynamically determine whether to use offscreen surface based on need (#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 9f6401362d Don't crash but warn when the scene builder specifies no layers. (#14008) 2019-11-25 15:38:41 -08:00
Kaushik Iska 584d958688 [fuchsia] Capture SkRRect in scene_update_context by value (#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 97a23a80e1 Made a way to turn off the OpenGL operations on the IO thread for backgrounded apps (#13908) 2019-11-22 14:08:33 -08:00
gaaclarke 89e395853c Refactor to passing functions by const ref (#13975)
Moved our code to passing functions by const ref
2019-11-22 12:20:02 -08:00
Kaushik Iska af2c53ab13 [fuchsia] Ensure we do not initialize nan RoundedRectangles (#13971)
Also initializes physical shape layer vars to empty.
2019-11-21 19:40:06 -08:00
liyuqian 9e6d360177 Fix picture raster cache throttling (#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
Chinmay Garde 75ea3e2445 Expose the platform view mutator stack to custom compositors. (#13731)
This allows custom compositors to affect scene builder modifications made
to the platform view.

Fixes https://github.com/flutter/flutter/issues/44211
Fixes b/143612326
2019-11-19 10:35:41 -08:00
James Robinson 0832dfde5a [flow][fuchsia] Add more tracing to layers and Fuchsia surface pool (#13864)
This adds more trace events to more layer operations and enhances the
trace counters for the Fuchsia vulkan surface pool to include retained
surface counts, emit stats on recycle events that might change the
surface count, and by separating counters which measure bytes from
counters which measure counts to make analysis simpler.
2019-11-14 15:31:37 -08:00
Michael Klimushyn 8a99d10748 Turn on RasterCache based on view hierarchy (#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 0a8bd9dd6f Fix mDNS for iOS13 (#13451) 2019-11-01 15:29:15 -07:00
Michael Klimushyn e609577d12 Revert "Turn on RasterCache based on view hierarchy (#13360)" (#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 3ad3bc76a5.
2019-10-30 11:25:29 -07:00
Michael Klimushyn 3ad3bc76a5 Turn on RasterCache based on view hierarchy (#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
Chinmay Garde e3aff2c982 Make sure root surface transformations survive resetting the matrix directly in Flow. (#13405)
This used to only be handled correctly for non-root layer backing stores. This
was mostly a side effect of the fact that we used recording canvases instead of
rendering directly into the backing store. We now use recording canvases
consistently.

Fixes b/143464703
Fixes https://github.com/flutter/flutter/issues/43732
2019-10-29 17:44:57 -07:00
Jason Simmons 4f85010d21 Do not attempt to drain the SkiaUnrefQueue in the destructor (#13237)
SkiaUnrefQueue should be empty at destruction time.  If the queue is nonempty,
then there will be a pending drain task that will hold a reference to the
queue.  The queue can only be destructed after the drain completes and the
reference is dropped.

Drains must only be done on the queue's task runner thread, which may not be
the thread where the queue is destructed.
2019-10-21 14:14:18 -07:00
Chinmay Garde c92613bc49 Re-land "Custom compositor layers must take into account the device pixel ratio."
This reverts commit 6c2381da60 and applies iOS fixes.
2019-10-17 14:07:51 -07:00
Chinmay Garde 6c2381da60 Revert "Custom compositor layers must take into account the device pixel ratio. (#13193)" (#13211)
This reverts commit e53d10c345.
2019-10-17 12:59:27 -07:00
Chinmay Garde e53d10c345 Custom compositor layers must take into account the device pixel ratio. (#13193)
The contents rendered into the backing stores are already correctly scaled.
The initial implementation assumed this also held true for the metrics obtained
via embedded view parameters.

Fixes b/142699417
2019-10-17 12:04:13 -07:00