106 Commits

Author SHA1 Message Date
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
Chinmay Garde
a0a8fb04d8 Wire up Metal shader precompilation from offline training runs. (flutter/engine#25644) 2021-04-19 16:24:02 -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
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
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
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
Chris Bracken
2586db3b22 Clean up C++ includes (flutter/engine#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Emmanuel Garcia
2f8279900b Reland: Enable hybrid composition by default on Android (#20722) (flutter/engine#20864)
This reverts commit bb885a23e20d79c163dc884530acaafd6c311f2a.
2020-08-31 12:17:11 -07:00
Kaushik Iska
5e969b46ef [embedder] Add gl present callback that takes present info (flutter/engine#20672) 2020-08-26 15:53:01 -07:00
Emmanuel Garcia
bb885a23e2 Revert "Enable hybrid composition by default on Android (#20722)" (flutter/engine#20745)
This reverts commit e57e7810a1c62535832abce02393e830fbd7f306.
2020-08-25 09:54:13 -07:00
Emmanuel Garcia
e57e7810a1 Enable hybrid composition by default on Android (flutter/engine#20722) 2020-08-24 13:10:23 -07:00
Kaushik Iska
a8c392e6b8 [embedder] Add FBO callback that takes frame info (flutter/engine#20617) 2020-08-19 16:06:02 -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
Chris Yang
b842ba72a6 Rework GLContextSwitch, get rid of RendererContextManager (flutter/engine#18601) 2020-06-04 11:37:51 -07:00
Chris Yang
80c707a642 Introduce TaskRunnerAffineWeakPtrFactory to generate TaskRunnerAffineWeakPtrs (flutter/engine#18346) 2020-05-19 16:36:17 -07:00
Chris Yang
d1d6103681 Introduce TaskRunnerChecker, TaskRunnerAffineWeakPtr (flutter/engine#17649) 2020-05-01 11:28:20 -07:00
Jim Graham
17e3cf8e55 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
52e74298e0 Revert PRs to unblock David and Jim's work (flutter/engine#14088)
* Revert "Add flow test fixtures and tests (#13986)"

This reverts commit 32915132bacdfd0d631421b23bb6a6d5db1095ab.

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

This reverts commit a13401ce86b3019c39154d56644b7b9eb4a5bbe5.
2019-12-03 12:02:37 -08:00
Jim Graham
a13401ce86 Dynamically determine whether to use offscreen surface based on need (flutter/engine#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
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
Chris Yang
590dc94eb8 Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13759)" (flutter/engine#13788)
This reverts commit 6390e62036d69c4923cc6cf2379b9eb9f25870ba.
2019-11-11 17:17:18 -08:00
Chris Yang
6390e62036 Reland "Guarding EAGLContext used by Flutter #13314" (flutter/engine#13759) 2019-11-08 20:09:18 -08:00
Chris Yang
68754a85f0 Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13755)" (flutter/engine#13757)
This reverts commit a4a346f317c867663a6d8a5d9c7909101d9b5cbd.
2019-11-08 13:44:29 -08:00
Chris Yang
a4a346f317 Reland "Guarding EAGLContext used by Flutter #13314" (flutter/engine#13755) 2019-11-08 12:26:48 -08:00
Chris Yang
af43ff4a31 Revert "Always use IOSGLContextSwitch to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (#13314)" (flutter/engine#13753) 2019-11-08 10:59:45 -08:00
Chris Yang
4953fbdd3f Always use IOSGLContextSwitch to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (flutter/engine#13314) 2019-11-08 10:02:23 -08:00
liyuqian
892f852039 Change IO thread shader cache strategy (flutter/engine#13121)
So it's the same with the GPU thread.

Otherwise, some shaders may be cached in binary on the IO thread, and we will lose them when we do the SkSL precompile.

For b/140174804
2019-10-14 13:05:05 -07:00
liyuqian
7bffe3c0a8 SkSL precompile (flutter/engine#12412)
For https://github.com/flutter/flutter/issues/40686

Unit tests added:
- CacheSkSLWorks
- VisitFilesCanBeCalledTwice
- CanListFilesRecursively
2019-10-08 11:51:28 -07:00
Chinmay Garde
591f55b39d Allow embedder controlled composition of Flutter layers. (flutter/engine#10195)
This patch allows embedders to split the Flutter layer tree into multiple
chunks. These chunks are meant to be composed one on top of another. This gives
embedders a chance to interleave their own contents between these chunks.

The Flutter embedder API already provides hooks for the specification of
textures for the Flutter engine to compose within its own hierarchy (for camera
feeds, video, etc..). However, not all embedders can render the contents of such
sources into textures the Flutter engine can accept. Moreover, this composition
model may have overheads that are non-trivial for certain use cases. In such
cases, the embedder may choose to specify multiple render target for Flutter to
render into instead of just one.

The use of this API allows embedders to perform composition very similar to the
iOS embedder. This composition model is used on that platform for the embedding
of UIKit view such and web view and map views within the Flutter hierarchy.
However, do note that iOS also has threading configurations that are currently
not available to custom embedders.

The embedder API updates in this patch are ABI stable and existing embedders
will continue to work are normal. For embedders that want to enable this
composition mode, the API is designed to make it easy to opt into the same in an
incremental manner.

Rendering of contents into the “root” rendering surface remains unchanged.
However, now the application can push “platform views” via a scene builder.
These platform views need to handled by a FlutterCompositor specified in a new
field at the end of the FlutterProjectArgs struct.

When a new platform view in introduced within the layer tree, the compositor
will ask the embedder to create a new render target for that platform view.
Render targets can currently be OpenGL framebuffers, OpenGL textures or software
buffers. The type of the render target returned by the embedder must be
compatible with the root render surface. That is, if the root render surface is
an OpenGL framebuffer, the render target for each platform view must either be a
texture or a framebuffer in the same OpenGL context. New render target types as
well as root renderers for newer APIs like Metal & Vulkan can and will be added
in the future. The addition of these APIs will be done in an ABI & API stable
manner.

As Flutter renders frames, it gives the embedder a callback with information
about the position of the various platform views in the effective hierarchy.
The embedder is then meant to put the contents of the render targets that it
setup and had previously given to the engine onto the screen (of course
interleaving the contents of the platform views).

Unit-tests have been added that test not only the structure and properties of
layer hierarchy given to the compositor, but also the contents of the texels
rendered by a test compositor using both the OpenGL and software rendering
backends.

Fixes b/132812775
Fixes flutter/flutter#35410
2019-08-13 14:53:19 -07:00
Dan Field
06e7030b0f Reland Skia Caching improvements (flutter/engine#10434) 2019-08-02 19:31:57 -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
Dan Field
d075f5f97f Improve caching limits for Skia (flutter/engine#9503) 2019-06-26 16:21:46 -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
Matthew Dempsky
0bca459e28 Replace ararysize macro with fml::size function (flutter/engine#8975)
This is forward compatible with std::size and similar to how Chromium
removed use of the arraysize macro.
2019-05-15 12:43:47 -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
4dd267959f Rename the shell namespace to flutter. (flutter/engine#8520) 2019-04-09 17:10:46 -07:00
Chinmay Garde
c37c0d78b0 Respect the custom GL proc table when creating the resource context on the IO thread. (flutter/engine#7893)
Fixes https://github.com/flutter/flutter/issues/28229
2019-02-20 17:23:14 -08:00
Brian Osman
3dd1198f0d Remove SkColorSpaceXformCanvas, use color-managed SkSurfaces instead (flutter/engine#7548)
Behavior (visual) changes should be very minor. Things that are to be expected:
* A few things were not color managed correctly by the transform canvas (color emoji, some color filters). Those will be handled correctly with the tagged surfaces (although we're always transforming to sRGB, so nothing should change until we target a wider gamut).
* Image filtering will happen in the source color space, rather than the destination. Very minor.
* The transform canvas did caching of images in the destination color space. Now, the conversion happens at draw time. If there are performance issues, images can be pre-converted to the destination with makeColorSpace().
2019-01-22 15:34:51 -05:00
Michael Goderbauer
41fdd03757 Fix EXIF orentation problem (flutter/engine#6974) 2018-11-27 14:12:13 -08:00
Michael Goderbauer
082336e7c2 Fix code smells reported by chrome's clang plugin (flutter/engine#6833) 2018-11-12 19:59:29 -08:00
Jason Simmons
c1c5977c07 Ensure that the EGL rendering context is bound to the GPU thread in Rasterizer::MakeRasterSnapshot (flutter/engine#6816)
Fixes https://github.com/flutter/flutter/issues/24083
2018-11-09 17:05:05 -08:00