612 Commits

Author SHA1 Message Date
Jim Graham
29e74fa44c Render DisplayLists to leaf_builder by reference and handle opacity (flutter/engine#32880) 2022-04-22 19:34:04 -07:00
Jim Graham
1afb88d9e4 Reland: simplify the logic around computing subtree opacity inheritance (flutter/engine#32853) 2022-04-22 16:19:04 -07:00
Jim Graham
165f0cffe5 add DlPaint object for optional use with DisplayListBuilder (flutter/engine#32860) 2022-04-22 15:54:03 -07:00
Jim Graham
c3ba36bdb8 Revert "simplify the logic around computing subtree opacity inheritance (#32698)" (flutter/engine#32849)
This reverts commit ded63468699560d1cf7c3a574dd742891057f104.
2022-04-21 16:59:32 -07:00
Dan Field
9e46531319 Remove redundant trace events (flutter/engine#32812) 2022-04-21 13:28:03 -07:00
Jim Graham
ded6346869 simplify the logic around computing subtree opacity inheritance (flutter/engine#32698) 2022-04-21 13:14:04 -07:00
Jason Simmons
fa6cf95880 Remove use of stringstream in the FrameTimingsRecorder constructor (flutter/engine#32840) 2022-04-21 12:24:06 -07:00
Jim Graham
272d144c55 Verbose display list comparisons (flutter/engine#32737) 2022-04-19 23:04:03 -07:00
linxuebin
1dbe7a6cd5 Skip LayerTree::Preroll LayerTree::Paint & Swapbuffer when frame_damage is empty (flutter/engine#32351) 2022-04-13 20:59:04 -07:00
Jim Graham
bd89e4452a Designated field initialization of Paint/PrerollContexts (flutter/engine#32634) 2022-04-12 20:59:05 -07:00
Kaushik Iska
172d0b24e5 Enable leaf layer tracing in PaintContext (flutter/engine#32383) 2022-04-11 18:24:04 -07:00
wangying
cf5855af97 Enable ShaderMask support RasterCache (flutter/engine#32027) 2022-04-11 18:19:04 -07:00
ColdPaleLight
ffe61d39ca Reland "Add a way to raster cache the children of a Layer (#32370)" (flutter/engine#32378) 2022-04-06 04:16:04 -07:00
Kevin Lubick
cdd2946003 Fix includes of SkColorSpace et al (flutter/engine#32382) 2022-04-01 10:59:23 -07:00
Kaushik Iska
a0f03a0220 Refactor drawing to offscreen surface (flutter/engine#32338) 2022-04-01 05:40:36 -04:00
Zachary Anderson
be05bbafbf Revert "Add a way to raster cache the children of a Layer" (flutter/engine#32370) 2022-03-31 16:56:04 -07:00
Matej Knopp
190cee38d1 Specify clip alignment for partial repaint (flutter/engine#31359)
* Specify clip alignment for partial repaint
2022-03-31 23:53:42 +02:00
ColdPaleLight
d39f658ea9 Add a way to raster cache the children of a Layer (flutter/engine#31875) 2022-03-30 21:10:02 -07:00
Chinmay Garde
351494f717 Add support for images in display lists. (flutter/engine#32268) 2022-03-30 13:31:37 -07:00
ColdPaleLight
5850d41dd0 Make sure that 'BeginFrame' and 'EndFrame' of the 'ExternalViewEmbedder' are paired (flutter/engine#32058) 2022-03-24 14:25:03 -07:00
Chinmay Garde
3088a62e29 Allow surface implementations to control when the raster cache may be enabled. (flutter/engine#32213) 2022-03-23 10:23:14 -07:00
ColdPaleLight
9af8b0bf05 Fix crash about 'SkiaUnrefQueue::Drain' is called after 'IOManager' reset (flutter/engine#32106) 2022-03-21 14:45:10 -07:00
wangying
1ec74e1bba Enable ColorFilterLayer support RasterCache (flutter/engine#31589) 2022-03-20 21:30:05 -07:00
Chinmay Garde
34f3581a3c Switch the renderer to impeller based on the presence of a command line flag. (flutter/engine#31959)
Specifying the `--enable-impeller` flag will switch the renderer to using
Impeller instead of Skia. On platforms where Impeller is not supported, this
flag is ignored.

The notion of the `flutter::SurfaceFrame` has been augmented. Now, in the
absence of a Skia surface to render to, the surface frame will render into a
display list instead.

Impeller variants of the context and surface variants have been added to
`shell/gpu` and `shell/platform`. The variants prepare surface frames that
don’t/can’t specify a Skia surface thus forcing the surface frame to render to a
display list instead. Then, in the submit callback, they forward the display
list ops to the Impeller display list dispatcher.

This scheme has been chosen as it requires the fewest updates to engine
internals which all depend on Skia data structures. Instead of updating all
call-sites to be Skia neutral, the display list interface itself is being made
graphics package agnostic.
2022-03-15 14:12:53 -07:00
Matej Knopp
256574230d Fix PhysicalShapeLayer paint bounds with clipping disabled (flutter/engine#31656)
* Fix PhysicalShapeLayer paint bounds with clipping disabled

* Add missing SkRect initialization
2022-02-24 14:52:35 -05:00
Kevin Lubick
870831d279 Fix includes of Skia types (flutter/engine#31654) 2022-02-24 10:56:05 -08:00
George Wright
b531809f09 Add a complexity scoring class for Metal and OpenGL (flutter/engine#31417) 2022-02-17 20:01:40 -08:00
ColdPaleLight
d2640b977f Start consolidating the caches in RasterCache (flutter/engine#31492) 2022-02-17 13:54:11 -08:00
Zachary Anderson
eca60c0b90 Add clang-analyzer-* and clang-diagnostic-* to .clang-tidy (flutter/engine#31291) 2022-02-09 12:26:34 -08:00
George Wright
ae19d36ca7 Small cleanup to DisplayListComplexityScoreCalculator code (flutter/engine#31211) 2022-02-02 09:37:52 -08:00
George Wright
a25be9e8d9 Add a DisplayListComplexityCalculator class that calculates the current "complexity score" of a given DisplayList during the Build phase. (flutter/engine#31176) 2022-02-01 21:40:35 -08:00
eggfly
42cc820c92 Cleanup unused code in the UIDartState and other tests. (flutter/engine#31152) 2022-01-31 18:20:02 -08:00
Brandon DeRosier
925224a9ee Prefix remaining OS defines with FML_ namespace (flutter/engine#31172) 2022-01-31 14:31:44 -08:00
Brandon DeRosier
2d4f908b9d Add FML_ prefix to fml/build_config.h macros (flutter/engine#31141) 2022-01-31 11:53:51 -08:00
eggfly
3a83d125d9 Remove unused Counter and CounterValues class. (flutter/engine#31130) 2022-01-28 16:05:10 -08:00
eggfly
1d4b9857fc [Android] Get the right frame_budget when device frame_rate is not 60 (flutter/engine#30924) 2022-01-27 13:35:10 -08:00
Matej Knopp
59414a9cd2 Only provide frame damage to rasterizer if partial repaint is enabled (flutter/engine#30704) 2022-01-12 15:19:01 +01:00
Matej Knopp
d071a24b95 Fix crash in BackdropFilterLayer::Diff (flutter/engine#30460)
* Fix crash in BackdropFilterLayer::Diff

* Pass context transform to filterBounds instead of scaling the filter
2022-01-04 23:17:32 +01:00
Chinmay Garde
0b18437bc1 Move the major display list classes to their own translation units. (flutter/engine#30487)
No functional change. Makes the display list subsystem easier to navigate as the
major classes are in their own TUs. Also avoids importing unnecessary headers
when the previous kitchen sink header was imported. I've tried to remove all
display list related imports and start from scratch but I may have missed some
files. Minor structs and classes (like the ones in utils, ops, etc..) still
don't get their own TUs though.

There were [two](https://github.com/flutter/engine/pull/29562) [related](https://github.com/flutter/engine/pull/30484) changes being made to this subsystem that have since
landed. So I don't think I am stepping on anyones toes with the reorganization.
Happy to incorporate any work-in-progress changes being made to the this
subsystem before submitting.
2021-12-28 15:19:35 -08:00
Chinmay Garde
942f2a979f Move display list to its own library. (flutter/engine#30398) 2021-12-20 17:14:01 -08:00
Jim Graham
46a8def326 Opacity peephole optimization (flutter/engine#29775) 2021-12-14 16:19:09 -08:00
Dan Field
b38b90c039 Revert "Fix eglPresentationTimeANDROID is no effective" (flutter/engine#30310)
* Revert "Fix eglPresentationTimeANDROID is no effective (#30182)"

This reverts commit 0d7ba05d3456807e7e24353fe911738952a02888.

* Revert "Use eglPresentationTimeANDROID to avoid bogging down the GPU (#29727)"

This reverts commit edb87942de0404a2802351c050a4f1b6de239bd7.
2021-12-13 20:02:20 -08:00
Jenn Magder
f134ae9ac4 Remove implicit copy assignment operator for 'EmbeddedViewParams' (flutter/engine#30094) 2021-12-06 09:34:01 -08:00
Dan Field
edb87942de Use eglPresentationTimeANDROID to avoid bogging down the GPU (flutter/engine#29727)
Fixes flutter/flutter#93352

Improves Android benchmarks on both Pixel 4 and a lower end Android Go device for 99th percentile and average raster times.

This works by telling the system compositor what timestamp we intended to show this frame for. This way, if we end up with a frame that gets submitted right at the beginning of a vsync and then a second frame submitted on the same vsync, the compositor will only try to show the second frame on the screen and save the GPU some work.

Without this, a situation like that results in an "avalanche" of calls where the GPU is behind the CPU and keeps delaying CPU work until we finally stop submitting frames. This can be observed as a lengthy dequeuBuffer in a systrace enabled trace, as shown in the linked issue. This avalanche is often triggered by a frame that does a shader compile through a couple vsyncs and then is followed by a bunch of very fast frames that take less than a vsync to render - the first of those fast frames gets delivered before the end of the vsync that the slow frame ended in.

We cannot implement this ourselves because we don't know how long the swap buffers call will take on the system side, and if we try to guess we can very well get it wrong.

I've filed issues to look into adding this for Vulkan and Metal, although we should also first take traces there to make sure it's warranted.

See also: https://android-developers.googleblog.com/2020/04/high-refresh-rate-rendering-on-android.html
2021-11-19 09:29:51 -08:00
Jenn Magder
b39436f7e5 Fix darwin namespace-comments and brace lint issues (flutter/engine#29828) 2021-11-18 21:06:56 -08:00
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Zachary Anderson
03c0f7e453 Add 'explicit' to header files (flutter/engine#29741) 2021-11-17 12:49:16 -08:00
Matej Knopp
0134f93710 PhysicalShapeLayer: Only push cull rect during diff if clipping (flutter/engine#29783) 2021-11-17 14:46:52 +01:00
Jim Graham
6c74b3f717 Call DisplayList builder methods directly from dart canvas (flutter/engine#29714) 2021-11-16 14:18:04 -08:00
Jenn Magder
dbe42683b9 Fix 'google-readability-braces-around-statements' analyzer warning in macOS and iOS (flutter/engine#29723) 2021-11-12 18:42:29 -08:00