79 Commits

Author SHA1 Message Date
Chris Bracken
ca1db50228 Revert "Rasterizer is initialized with an external view embedder (#22348)" (flutter/engine#22367)
This reverts commit cccecc46e10341d655b6bd388222f189215da506.

Due to merge conflicts, this also reverts #22275:

Revert "Do not involve external_view_embedder in submit frame process if threads are not merged. (#22275)"

This reverts commit d3902fc979fac68d498e4fe33584647c375c06ac.
2020-11-06 15:26:47 -08:00
Kaushik Iska
cccecc46e1 Rasterizer is initialized with an external view embedder (flutter/engine#22348)
This allows us to not rely on surface methods for getting
the external view embedder.
2020-11-06 09:01:28 -08:00
Kaushik Iska
a5f4486147 Reland multiple display support for embedder API (flutter/engine#21464) 2020-09-28 12:35:34 -07:00
Kaushik Iska
bd90847bad Revert multiple display support for embedder API (flutter/engine#21456)
This reverts commits
- 5f34b8442366463b5ad53e3e87e7920a006392eb.
- fc8b468d84f1fef5bf5183dd0b36d9411d454ea7.

See: https://github.com/flutter/flutter/issues/66829
2020-09-28 09:46:46 -07:00
Kaushik Iska
5f34b84423 Embedder API Support for display settings (flutter/engine#21355)
Embedders can now notify shell during startup about the various displays and their corresponding settings.
Adds a notion of Display update type which can later include chages to displays during runtime such as addition / removal / reconfiguration of displays.

We also remove the responsibility of providing the refresh rate from `vsync_waiter` to `DisplayManager`.
Rewires existing platform implementations of the said API to use `Shell::OnDisplayUpdate` to notify the display manager of the startup configuration.

DisplayManager is also thread-safe to account for rasterizer and UI thread accesses.
2020-09-25 11:04:10 -07:00
Matej Knopp
62a0f720af Discard wrong size layer tree instead of rendering it (flutter/engine#21179) 2020-09-18 12:37:02 -07:00
0xZero
c70c748e0d Member variables should appear before the |WeakPtrFactory|. (flutter/engine#20899) 2020-09-03 14:34:01 -07:00
Emmanuel Garcia
9d05be2966 Add ability to disable the raster thread merger (flutter/engine#20800) 2020-08-28 17:25:00 -07:00
Chris Yang
c85f437dc9 |MessageLoopImpl::FlushTasks| runs one task at a time (flutter/engine#20771) 2020-08-27 14:18:02 -07:00
David Worsham
f98d00315d fuchsia: Call out legacy rasterizer code (flutter/engine#20761) 2020-08-26 19:36:14 -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
Chris Yang
72162b7a66 Ensure threads are merged when tearing down the Rasterizer (flutter/engine#19919) 2020-08-19 08:31:01 -07:00
Dan Field
b43d17a5a3 Remove the dummy rasterizer delegate now that flutter_runner is in tree, and cleanup ctor params (flutter/engine#20486) 2020-08-13 14:46:01 -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
Kaushik Iska
ce2baf1ce0 Revert "Remove pipeline in favor of layer tree holder (#18901)" (flutter/engine#19066)
Reverting for b/158816279
2020-06-16 13:15:57 -07:00
Chris Yang
c80477385d Make rasterizer screenshot work with gl_context_switch (flutter/engine#18850) 2020-06-10 10:00:43 -07:00
David Worsham
d2b7646e68 Move Surface and friends to flow/ (flutter/engine#18938) 2020-06-09 16:03:01 -07:00
Kaushik Iska
1430d4e26b Remove pipeline in favor of layer tree holder (flutter/engine#18901)
Relanding of a change that was reverted in:
https://github.com/flutter/engine/pull/18427
2020-06-09 12:19:34 -07:00
gaaclarke
851f2e76b0 Made the Rasterizer avoid GPU calls when backgrounded (flutter/engine#18563) 2020-05-26 21:02:40 -07:00
Chris Yang
80c707a642 Introduce TaskRunnerAffineWeakPtrFactory to generate TaskRunnerAffineWeakPtrs (flutter/engine#18346) 2020-05-19 16:36:17 -07:00
Kaushik Iska
5519277f4a Revert "Remove pipeline in favor of layer tree holder (#18285)" (flutter/engine#18427)
This reverts commit 0219ee95d8ffdef4d839f0419ce5e1f22b27d8d1.
2020-05-15 12:27:32 -07:00
Kaushik Iska
0219ee95d8 Remove pipeline in favor of layer tree holder (flutter/engine#18285)
go/flutter-pipeline-improvements for more details.
2020-05-14 10:46:14 -07:00
Kaushik Iska
1785bb19b0 Revert "Remove pipeline in favor of layer tree holder (#17688)" (flutter/engine#18242) 2020-05-08 16:09:02 -07:00
Kaushik Iska
dee9634111 Remove pipeline in favor of layer tree holder (flutter/engine#17688)
go/flutter-pipeline-improvements for more details.
2020-05-08 10:51:10 -07:00
Chris Yang
d1d6103681 Introduce TaskRunnerChecker, TaskRunnerAffineWeakPtr (flutter/engine#17649) 2020-05-01 11:28:20 -07:00
Jason Simmons
02720fbca8 Fix include paths of fml/time headers in the shell and rasterizer (flutter/engine#17502) 2020-04-03 12:33:54 -07:00
Kaushik Iska
ce0ec9042f [pipeline] Add trace event for lag between target and display times (flutter/engine#17384)
This change also adds TimeRecorder which records time at the start
of each frame to capture the latest vsync target display time and
wires it in to the rasterizer to add trace events when there is a lag.
2020-04-02 17:15:45 -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
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
Dan Field
62a99c60c5 the the fix (flutter/engine#15973) 2020-01-24 12:43:32 -08:00
Jason Simmons
b8182fbd53 Convert images to raster on the GPU thread for Image.toByteData (flutter/engine#13647)
If the image is a cross-context image that might be read from the GPU thread
during onscreen rendering, then it is not safe to read it concurrently from
the IO thread as part of Image.toByteData.

If the GPU thread does not have a graphics context, then fall back to
converting the image on the IO thread.

Fixes https://github.com/flutter/flutter/issues/30697
2019-11-25 14:44:57 -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
Todd Volkert
02a18868b3 Revert "RendererContextSwitch guard flutter's gl context rework. (#13812)" (flutter/engine#13906)
This reverts commit 7552e9370527aae8df06b43dcb6b313d9ebdb365.

This is being reverted because it caused flutter/flutter#45098
(images don't load on iOS).
2019-11-18 18:28:04 -08:00
Chris Yang
7552e93705 RendererContextSwitch guard flutter's gl context rework. (flutter/engine#13812) 2019-11-14 11:50:45 -08:00
gaaclarke
674871d1f5 Revert fd3dac0f589befb45a0687fa8643b400fd07733a (flutter/engine#13467)
Put `Picture.toImage` back on the GPU thread.  Left the unit tests intact.
2019-10-31 16:57:52 -07:00
liyuqian
f8f285edcc Support non-60 refresh rate on PerformanceOverlay (flutter/engine#11419)
So we can get the correct graph on 90fps/120fps devices :)

See https://github.com/flutter/flutter/issues/37888
2019-08-24 15:22:52 -07:00
Kaushik Iska
de1c728dab Allow for dynamic thread merging on IOS for embedded view mutations (flutter/engine#9819)
After pre-roll we know if there have been any mutations made to the IOS embedded UIViews. If there are any mutations and the thread configuration is such chat the mutations will be committed on an illegal thread (GPU thread), we merge the threads and keep them merged until the lease expires. The lease is currently set to expire after 10 frames of no mutations. If there are any mutations in the interim we extend the lease.

TaskRunnerMerger will ultimately be responsible for enforcing the correct thread configurations.

This configuration will be inactive even after this change since still use the same thread when we create the iOS engine. That is slated to change in the coming PRs.
2019-08-12 12:32:38 -07:00
Dan Field
06e7030b0f Reland Skia Caching improvements (flutter/engine#10434) 2019-08-02 19:31:57 -07:00
Chinmay Garde
3d8db4a1f6 Document //flutter/shell/common/rasterizer (flutter/engine#9809) 2019-07-15 17:45:47 -07:00
gaaclarke
fd3dac0f58 Made Picture::toImage happen on the IO thread with no need for an onscreen surface. (flutter/engine#9813)
Made Picture::toImage happen on the IO thread with no need for a surface.
2019-07-15 17:16:20 -07:00
Dan Field
792d6a27f8 Revert "Improve caching limits for Skia (#9503)" (flutter/engine#9740)
This reverts commit d075f5f97f97b339783e7915f92165aedcad5ed6.
2019-07-10 12:09:42 -07:00
Kaushik Iska
9815a20559 Raster now returns an enum rather than boolean (flutter/engine#9661)
This is part of a bigger change that will facilitate us
to act on this `RasterStatus`. The specific case is where
after pre-roll we might decide to want to merge the threads
and re-submit the frame -- `RasterStatus::kResubmit` can then
let us achieve this result.
2019-07-03 19:53:01 -07:00
Dan Field
d075f5f97f Improve caching limits for Skia (flutter/engine#9503) 2019-06-26 16:21:46 -07:00
Dan Field
9b08763a75 Purge caches on low memory on iOS (flutter/engine#9491) 2019-06-25 20:47:55 -07:00
gaaclarke
686215ac99 Added class docstrings for classes inside of shell/common. (flutter/engine#9303)
Added class docstrings for classes inside of shell/common.
2019-06-13 16:15:10 -07:00
Dan Field
903bb51f0e Unbreak internal rolls (flutter/engine#9270)
Adds back constructor for Rasterizer temporarily
2019-06-11 08:52:41 -07:00
liyuqian
fb0ea0ef4c Add onReportTimings and FrameRasterizedCallback API (flutter/engine#8983)
Using it, a Flutter app can monitor missing frames in the release mode, and a custom Flutter runner (e.g., Fuchsia) can add a custom FrameRasterizedCallback.

Related issues:
https://github.com/flutter/flutter/issues/26154
https://github.com/flutter/flutter/issues/31444
https://github.com/flutter/flutter/issues/32447

Need review as soon as possible so we can merge this before the end of May to catch the milestone.

Tests added:
* NoNeedToReportTimingsByDefault
* NeedsReportTimingsIsSetWithCallback
* ReportTimingsIsCalled
* FrameRasterizedCallbackIsCalled
* FrameTimingSetsAndGetsProperly
* onReportTimings preserves callback zone
* FrameTiming.toString has the correct format

This will need a manual engine roll as the TestWindow defined in the framework needs to implement onReportTimings.
2019-06-06 10:42:48 -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
Chinmay Garde
2b4e6ce82b Merge flutter/synchronization contents into fml. (flutter/engine#8525)
When flutter/synchronization was first authored, we did not own fml (it was called fxl then). Now we do, so use a single spot for such utilities. The pipeline was meant to be a general purpose utility that was only ever used by the animator (it even has animator specific tracing), so move that to shell instead (where the animator resides).
2019-04-09 19:18:51 -07:00