193 Commits

Author SHA1 Message Date
Dan Field
a73d5b5fbe Reland Enable MSAA behind a flag for iOS (flutter/engine#33505) 2022-05-19 23:58:05 -07:00
Dan Field
fd6330c745 Revert "Enable MSAA behind a command line flag for iOS (#33461)" (flutter/engine#33481)
This reverts commit ce9f6b2e43e2d88934345ac96bcb366a144b3408.
2022-05-19 09:23:58 -07:00
Dan Field
ce9f6b2e43 Enable MSAA behind a command line flag for iOS (flutter/engine#33461) 2022-05-18 17:07:05 -07:00
Chinmay Garde
7df5e81ea8 [impeller] Wire up the OpenGL ES Backend. (flutter/engine#33405) 2022-05-17 13:16:25 -07:00
Brandon DeRosier
08295d23f7 [Impeller] Change Renderer utility to pass RenderTarget to callback; render non-pipeline blend modes (flutter/engine#32982) 2022-05-09 23:49:06 -07:00
Dan Field
ec99c09baf Soft revert of 3a0d0b6e36deebc6d477daee9a3cc4dbd09a7900 (flutter/engine#32465) 2022-04-07 09:22:08 -07:00
Kevin Lubick
f7b0a59a84 [skia] Fix more transitive includes (flutter/engine#32430) 2022-04-07 08:53:54 -04:00
Kevin Lubick
cdd2946003 Fix includes of SkColorSpace et al (flutter/engine#32382) 2022-04-01 10:59:23 -07:00
Chinmay Garde
351494f717 Add support for images in display lists. (flutter/engine#32268) 2022-03-30 13:31:37 -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
Dan Field
f396ea98b7 Enable MSAA behind a flag for Android GL, add TODOs for other platforms (flutter/engine#32128) 2022-03-21 11:10:05 -07:00
eggfly
f3efac3388 [windows] Support win_debug_x86 compilation target in engine (flutter/engine#30417) 2022-03-15 20:10:10 -07:00
Dan Field
3a0d0b6e36 Support stencil buffers on OpenGL for Windows and Android (flutter/engine#31967) 2022-03-15 16:50:07 -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
ColdPaleLight
aa63b8f801 Migrate the API of GrDirectContext about resource memory limit (flutter/engine#31977) 2022-03-14 16:50:10 -07:00
Brandon DeRosier
d683f9a0c7 Vulkan support in the Embedder API (flutter/engine#29391) 2022-02-02 00:55:21 -08:00
Matej Knopp
549e82fec6 Enable partial repaint for Android/OpenGL (flutter/engine#29591) 2022-01-20 18:22:18 +01:00
ColdPaleLight
af5e4cf7f4 Add a trace to GpuSurfaceMetal around canvas flushing (flutter/engine#30667) 2022-01-13 09:31:42 -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
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
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
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Rulong Chen(陈汝龙)
d0e356a496 WeakPtrFactory should be destroyed before any other members. (flutter/engine#29402) 2021-11-11 06:08:01 -08:00
Matej Knopp
66a708c874 Enable partial repaint for iOS/Metal (flutter/engine#28801) 2021-11-02 07:20:01 -07:00
ColdPaleLight
4a74166097 Started providing the GPU sync switch to Rasterizer.DrawToSurface() (flutter/engine#28383)
Co-authored-by: Aaron Clarke <gaaclarke>
2021-09-01 11:37:22 -07:00
Chinmay Garde
7cfb375a5e Configure contexts to reduce shader variations. (flutter/engine#27016)
Context creation options for each backend were spread across multiple
translation units. This makes setting options common across all backends hard to
configure. I have moved the creation of such common options into a separate
translation unit.

Fixes https://github.com/flutter/flutter/issues/84213
2021-06-28 15:37:14 -07:00
Adlai Holler
3aaa10d762 Disable Skia reduceOpsTaskSplitting option (flutter/engine#26568)
This option will be the default in Skia soon. Per discussion in #26067, let’s be explicit about disabling it for the time being, and we can revisit the flag in the future if desirable.
2021-06-17 13:11:40 -07:00
George Wright
6978395603 Add Metal to the FlutterCompositor struct in the Embedder API (flutter/engine#25612) 2021-04-23 15:52:54 -07:00
Chinmay Garde
a0a8fb04d8 Wire up Metal shader precompilation from offline training runs. (flutter/engine#25644) 2021-04-19 16:24:02 -07:00
Dan Field
446b6a6a61 Support SKP captures in flutter_tester (flutter/engine#25566) 2021-04-14 09:39:01 -07:00
Chris Bracken
9b4a0264d5 Correct typos throughout the engine/embedder (flutter/engine#25346)
Used the the `misspell` tool available at
https://github.com/client9/misspell, then applied hand-corrections. It's
possible we could adopt this as a presubmit, but there are still enough
false positives that it may not be worth the effort.
2021-04-01 11:08:19 -07:00
Chris Bracken
13cf185e1c Correct setup-related typos (flutter/engine#24846)
Corrects uses of setup as a verb to 'set up', leaves noun/noun-phrase
forms of setup as 'setup'. Also settles on 'teardown' as opposed to
tear-down for consistency across the codebase.

A few other minor comment/wording corrections.
2021-03-08 17:31:10 -08:00
xster
e618085f1c Share Android surface GrDirectContext (flutter/engine#23798) 2021-01-22 12:44:02 -08:00
gaaclarke
ce537a2b51 reland of https://github.com/flutter/engine/pull/23634 (flutter/engine#23865) 2021-01-22 11:49:37 -08:00
Zachary Anderson
d1713a83ff Revert "implemented GetMainContext() for opengl (#23634)" (flutter/engine#23859)
This reverts commit ef108aeaed9a86a99c77dcc1c4373f940b532c01.
2021-01-22 09:54:24 -08:00
gaaclarke
ef108aeaed implemented GetMainContext() for opengl (flutter/engine#23634) 2021-01-21 09:43:06 -08:00
Kaushik Iska
eb3ab64883 [embedder] [metal] Add support for Metal Renderer Config in the embedder API (flutter/engine#22854)
This change adds a FlutterMetalRendererConfig that lets embedders
specify metal as rendering api.

Also adds a test that validates rendering a gradient using metal.
2021-01-01 20:39:36 -08:00
Kaushik Iska
b6daee84ec Reland "Introduce a delegate class for gpu metal rendering (#22611)" (flutter/engine#22777)
This reverts commit 0d71d27aa7d9058841bbba104021927c7f17b7ce.
2020-12-02 13:04:10 -06:00
Kaushik Iska
7d69fda39b Revert "Introduce a delegate class for gpu metal rendering (#22611)" (flutter/engine#22775)
This reverts commit 98f761acf90de8b60127ab0e7236d60866cb13e4.
2020-11-30 14:47:01 -06:00
Kaushik Iska
98f761acf9 Introduce a delegate class for gpu metal rendering (flutter/engine#22611) 2020-11-25 15:46:38 -06:00
Kaushik Iska
356e31aef5 Reland "remove surface dependance on external view embedder (#22468)" (flutter/engine#22470) 2020-11-12 15:37:12 -08:00
Kaushik Iska
ae4dbc51b8 Reverts 2 commits that remove surface dependance on external view embedder (flutter/engine#22468)
* Revert "Remove GetExternalViewEmbedder from surface (#22272)"

This reverts commit 9dffddd08d0ad6fa7434c5a5bdff87e09da92e57.

* Revert "Rasterizer is initialized with an external view embedder (#22405)"

This reverts commit 417c869d6bcd70ba82fdd6efc8db1efa19fb997c.
2020-11-12 08:41:11 -08:00
Kaushik Iska
9dffddd08d Remove GetExternalViewEmbedder from surface (flutter/engine#22272)
This decouples surfaces from view embedders.
2020-11-11 13:45:24 -08:00
Kaushik Iska
8b9acb11b8 Move common graphics utils to //flutter/common/graphics (flutter/engine#22320) 2020-11-10 12:34:02 -08:00
Chris Bracken
ef868edd36 Eliminate FLUTTER_NOLINT where possible (flutter/engine#21904)
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
2020-10-16 12:44:49 -07:00
Pieter van Loon
3ce29048c0 Enabled metal on ios simulator (flutter/engine#17881) 2020-10-07 17:47:03 -07:00
Jason Simmons
7987032038 Workaround for an Android emulator EGL bug that can cause inaccurate GL version strings (flutter/engine#21258) 2020-10-02 12:17:02 -07:00
bungeman
fd93916c27 Replace kLegacyFontHost_InitType with kUnknown_SkPixelGeometry. (flutter/engine#21474)
Skia is removing the deprecated legacy display setting globals and
associated kLegacyFontHost_InitType. This change replaces all such uses
with default surface properties with no special flags and an unknown
pixel geometry. Flutter never set the associated globals, leaving them
with their initial default values, which were no special flags and
horizontal RGB pixel geometry. The values used here are different but
this change should make no difference as Flutter never mentions
SkFont::kSubpixelAntiAlias to take advantage of the pixel geometry.
2020-09-29 12:46:08 -04:00
George Wright
67cfb02b18 Enable embedder_unittests on Fuchsia (flutter/engine#21418) 2020-09-28 11:12:02 -07:00
renyou
7d8dc2aa24 Fix an include path to match the others. (flutter/engine#21148) 2020-09-14 10:06:44 -07:00