23524 Commits

Author SHA1 Message Date
Matan Lurey
8d8a108d8a Enable clang-tidy for pre-push (opt-out), exclude performance-unnecessary-value-param (flutter/engine#44936)
Closes https://github.com/flutter/flutter/issues/132687.

Zach, this is a pretty naive attempt, so feel free to suggest alternatives. I considered for example just using `--checks=-{{LINT}}` as well, but figured that might be less discoverable (especially for non-core folks) than just a file called `.clang-tidy-for-githooks`.

/cc @jonahwilliams
2023-08-23 01:02:23 +00:00
John McCutchan
fe45ba18f0 Restore old SurfaceTextureExternal drawing code (flutter/engine#44979)
The simpler version I committed last week doesn't work correctly when
the texture has been transformed. This CL restores the old painting code
that properly handles this case.

Fixes internal b/296916021
2023-08-22 15:57:59 -07:00
skia-flutter-autoroll
ba0faabe73 Roll Skia from d0918de21c1a to aa208c8a2d60 (2 revisions) (flutter/engine#44981)
https://skia.googlesource.com/skia.git/+log/d0918de21c1a..aa208c8a2d60

2023-08-22 fmalita@chromium.org [skottie] Fix GaussianBlur repeat edge pixels
2023-08-22 brianosman@google.com Stop running two different scales on perf bots

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 22:50:22 +00:00
Jason Simmons
e6ed925c59 Initialize the texture destruction callback in the Metal embedder test harness (flutter/engine#44973) 2023-08-22 22:18:26 +00:00
Matan Lurey
258da2f14c Further filter/clear <SkPaint>.setDither(true), this time in DlSkPaintDispatchHelper (flutter/engine#44912)
Closes https://github.com/flutter/flutter/issues/132860.

- If `setDither(true)` is called, and an existing `setColorSource` is a gradient, it is ignored.
- If `setColorSource(...)` is called, and it is a gradient, and dithering was previously set, it is cleared.

I'm not sure this is fool proof.
2023-08-22 22:12:46 +00:00
skia-flutter-autoroll
2914e22dd0 Roll Dart SDK from 3ebf0fedfceb to ab417bc74bb1 (1 revision) (flutter/engine#44977)
https://dart.googlesource.com/sdk.git/+log/3ebf0fedfceb..ab417bc74bb1

2023-08-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-97.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 22:08:03 +00:00
skia-flutter-autoroll
477abd1918 Roll Skia from bf6019be75ef to d0918de21c1a (3 revisions) (flutter/engine#44975)
https://skia.googlesource.com/skia.git/+log/bf6019be75ef..d0918de21c1a

2023-08-22 johnstiles@google.com Enable SkSL testing in Graphite.
2023-08-22 lovisolo@google.com Update CPU dimension for NUC11TZi5 tasks: x86-64-avx2 -> x86-64-i5-1135G7.
2023-08-22 johnstiles@google.com Enable validation and user labels in Dawn test contexts.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 22:04:11 +00:00
skia-flutter-autoroll
544867ab52 Roll Skia from c675298ddeda to bf6019be75ef (3 revisions) (flutter/engine#44974)
https://skia.googlesource.com/skia.git/+log/c675298ddeda..bf6019be75ef

2023-08-22 johnstiles@google.com Remove empty source lists.
2023-08-22 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2cb515574109 to ceb93445a393 (3 revisions)
2023-08-22 herb@google.com Define line segment

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 20:54:20 +00:00
LongCatIsLooong
1a3cb621c9 Make FontWeight an enum, Remove unused text classes (flutter/engine#44960)
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-22 20:25:18 +00:00
skia-flutter-autoroll
5b344620e7 Roll Skia from 9f4b81aac175 to c675298ddeda (2 revisions) (flutter/engine#44971)
https://skia.googlesource.com/skia.git/+log/9f4b81aac175..c675298ddeda

2023-08-22 brianosman@google.com Remove logic for obsolete devices from nano_flags
2023-08-22 johnstiles@google.com Add support for Graphite unit tests that modify context options.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 20:07:08 +00:00
skia-flutter-autoroll
fb74804ecf Roll Skia from 50814d9ca5bb to 9f4b81aac175 (1 revision) (flutter/engine#44969)
https://skia.googlesource.com/skia.git/+log/50814d9ca5bb..9f4b81aac175

2023-08-22 johnstiles@google.com Consolidate SkSL sources/headers in Bazel.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 19:22:12 +00:00
Mouad Debbar
a7f0c0c789 [web] Move remaining web-only APIs to dart:ui_web (flutter/engine#44516)
- Warn on `webOnlyInitializePlatform` and replace all usages with `ui_web.bootstrapEngine`.
- Remove unused `webOnlyPaintedBy` parameter.
- `webOnlyDebugPhysicalSizeOverride` => `ui_web.debugPhysicalSizeOverride`.
- `webOnlyInstantiateImageCodecFromUrl` => `ui_web.createImageCodecFromUrl`.
- `WebOnlyImageCodecChunkCallback` => `ui_web.ImageCodecChunkCallback`.
- `_webOnlyDidWarnAboutPerformanceOverlay` => `_didWarnAboutPerformanceOverlay`.
- Remove unnecessary usage of `futurize`.

Part of https://github.com/flutter/flutter/issues/126831
2023-08-22 19:17:16 +00:00
Jim Graham
5fa5cb698e Revert "Split DisplayListBuilder into DlCanvas optimizer and DlOp recorder classes" (flutter/engine#44968)
Reverts flutter/engine#44718

A rendering issue was discovered in internal testing (b/296975714)
2023-08-22 19:14:48 +00:00
Reid Baker
9318d3d641 i82973 scroll mouse wheel support (flutter/engine#44724)
Fixes https://github.com/flutter/flutter/issues/82973

Mouse scroll wheel support for android. 

I chose to not cache the vertical and horizontal scale factors that come from view configuration. The primary reason is that in the current code path context is only used when the user scrolls which was the unimplemented feature. This smaller blast radius I decided was worth the additional calls. A secondary reason is that when the scale factors are changed is not a well documented path nor is there a lifecycle callback to listen to. Scroll factor is cached on api 25 and below because that more closely mirrors the behavior I see in pre 25 versions of android scroll view. 

Note flutter takes longer to "see" a mouse that then scrolls than android

Fixes #flutter/flutter/82973

Todo list prior to merge

## Links 
* Some pre api 26 scroll factor code 
    - https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/View.java?q=function:getVerticalScrollFactor%20filepath:android%2Fview%2FView.java&ss=android%2Fplatform%2Fsuperproject%2Fmain 
    - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=930;drc=2fe301db7555bccf53e465436d4cb7442c803df3;bpv=0;bpt=0
* Post api 26 scroll factor code 
    - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=361;drc=406e0f655387f27dda874c2b975fb0ddbd61aa13;bpv=0;bpt=0 
    - https://developer.android.com/reference/android/view/ViewConfiguration#getScaledVerticalScrollFactor()
2023-08-22 18:23:50 +00:00
gaaclarke
813080202e [Impeller] Tiny optimizations for text rendering (avoiding extra ops and copies). (flutter/engine#44822)
…and copies)

While investigating https://github.com/flutter/flutter/issues/131620 I
tried many things to squeeze the logic to make text batching faster. It
didn't pan out but here are a handful of tweaks that make a tiny
difference that I don't want to lose.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-08-22 11:23:36 -07:00
skia-flutter-autoroll
a64f1e1e4e Roll Dart SDK from ecb1e3aecfbb to 3ebf0fedfceb (1 revision) (flutter/engine#44962)
https://dart.googlesource.com/sdk.git/+log/ecb1e3aecfbb..3ebf0fedfceb

2023-08-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-96.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 17:47:14 +00:00
Brian Osman
1373f86c5a Add missing GrVkTypes include (flutter/engine#44957)
IWYU fix for an incoming Skia change. This header is needed for GrVkImageInfo.
2023-08-22 16:32:02 +00:00
skia-flutter-autoroll
bf155844f5 Roll Skia from a548d28072ce to eff8446c42f8 (2 revisions) (flutter/engine#44955)
https://skia.googlesource.com/skia.git/+log/a548d28072ce..eff8446c42f8

2023-08-22 michaelludwig@google.com Disable SurfaceContextWritePixels test on Intel Iris + Metal
2023-08-22 fmalita@chromium.org [sksg] Simplify image filters

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 16:03:53 +00:00
skia-flutter-autoroll
9304d9f1e0 Roll Skia from b3b8f3332cce to a548d28072ce (3 revisions) (flutter/engine#44953)
https://skia.googlesource.com/skia.git/+log/b3b8f3332cce..a548d28072ce

2023-08-22 robertphillips@google.com Revert "Check that instantiated texture matches the proxy's protectedness"
2023-08-22 nscobie@google.com Parameterize SurfaceContextWritePixels by renderability and origin
2023-08-22 johnstiles@google.com Add typedef to simplify enum-bitmasks with SkSLTestFlags.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 14:54:14 +00:00
skia-flutter-autoroll
174ae7797d Roll Skia from bf08da24a261 to b3b8f3332cce (1 revision) (flutter/engine#44952)
https://skia.googlesource.com/skia.git/+log/bf08da24a261..b3b8f3332cce

2023-08-22 robertphillips@google.com Check that instantiated texture matches the proxy's protectedness

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 14:04:33 +00:00
skia-flutter-autoroll
682050dc54 Roll Dart SDK from 00f6f69187df to ecb1e3aecfbb (1 revision) (flutter/engine#44950)
https://dart.googlesource.com/sdk.git/+log/00f6f69187df..ecb1e3aecfbb

2023-08-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-95.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 13:50:22 +00:00
skia-flutter-autoroll
6e41b072ab Roll Fuchsia Linux SDK from RVhmZNTYsaIiTyjwP... to kKI09su99b0AKs8b3... (flutter/engine#44949)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jimgraham@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 12:24:22 +00:00
Bruno Leroux
b7388399c8 [Linux] Expose channel buffers 'resize' and 'overflow' control commands (flutter/engine#44636)
## Description

This PR adds two helper functions to invoke the 'resize' and 'overflow' commands exposed by the control channel.
See:

c00c022036/lib/ui/channel_buffers.dart (L302-L309)

## Related Issue

Linux implementation for https://github.com/flutter/flutter/issues/132386

## Tests

Adds two tests.
2023-08-22 06:52:56 +00:00
skia-flutter-autoroll
4311fd5030 Roll Skia from 9ecdc9265aaa to 14e7b3b2d660 (1 revision) (flutter/engine#44942)
https://skia.googlesource.com/skia.git/+log/9ecdc9265aaa..14e7b3b2d660

2023-08-22 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Skia Infra from 572e236a3608 to fd820e605b8a (6 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jsimmons@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-22 05:46:18 +00:00
Brandon DeRosier
cdab07b84a [Impeller] Supply a text backend to the AiksContext at runtime. (flutter/engine#44884)
Resolves https://github.com/flutter/flutter/issues/130947.

- Allow for setting the text renderer (`TextRenderContext`) when the
`AiksContext` is built. Previously, the text renderer was selected at
build time through linking a `TextRenderContext::Create` symbol.
- Support using Impeller without a text backend. Throw a clear error
when trying to render text if no text backend is present.
- Don't track the Impeller context in `TextRenderContext`. Just let the
renderer supply its context when generating atlases.
- Allow for overriding the `TextRenderContext` for individual Aiks
playground tests/goldens.
2023-08-21 21:55:28 -07:00
Matan Lurey
af5d8338a9 Disallow using ./tools/gn --enable-unittests --android (or --ios) (flutter/engine#44930)
Closes https://github.com/flutter/flutter/issues/132611.

As seen on https://github.com/flutter/flutter/issues/132611, this will
never succeed compiling.

I tried to update the Wiki as well:

https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment#vscode-with-cc-intellisense-cc
2023-08-21 20:20:01 -07:00
Chinmay Garde
94a01878aa [Impeller] Document rendering backend selection on Android. (flutter/engine#44933)
Also add cross-references to some docs from the main README.
2023-08-21 17:19:15 -07:00
LongCatIsLooong
649a1e181c Reland "Implementing TextScaler for nonlinear text scaling (#42062)" (flutter/engine#44907)
The original PR crashes because of a JNI signature mismatch (`(FJ)F` -> `(FI)F`). Update the signature in a415da5619

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-21 23:16:10 +00:00
Dan Field
2a7a0fa977 [Impeller] Disable Impeller on Fuchsia (flutter/engine#44925)
In some build variations, `is_mac` or `is_linux` is true, but `target_os == "fuchsia"`.

We should explicitly disable Impeller in those variants.

Fixes https://github.com/flutter/flutter/issues/132793
2023-08-21 22:59:48 +00:00
gaaclarke
ef99e4345d [Impeller] Added recycled command buffers. (flutter/engine#44904)
Recycles command buffers instead of deleting them when they are done
being used.

@jonahwilliams profiled the Gallery on the Pixel 7 pro and saw that
sometimes `RenderPassVK::OnEncodeCommands` takes a long time in
https://github.com/flutter/flutter/issues/132690. After adding adding
more tracing it was found that the culprit was deleting the
CommandBuffers on the raster thread. This PR removes the deletion of the
CommandBuffers and instead resets and recycles them.


![unnamed](https://github.com/flutter/engine/assets/30870216/2136dda0-6747-43a7-9a94-a0223c55b704)

> where GARBO2 is
> ```c++
> void CommandPoolVK::GarbageCollectBuffersIfAble() {
>   TRACE_EVENT0("impeller", "CommandPoolVK::GARBO2");
>    if (std::this_thread::get_id() != owner_id_) {    
>      return;  
>    }
>    buffers_to_collect_.clear();
> }
> ```

This approach matches the guidances from ["Vulkan Best Practice for
Mobile
Developers"](https://arm-software.github.io/vulkan_best_practice_for_mobile_developers/samples/performance/command_buffer_usage/command_buffer_usage_tutorial.html)
where it is preferable to recycle command buffers than delete them.
Also, the recommendation is that if you are not reusing command buffers
that you should periodically reset the pool, which we weren't doing.

issue: https://github.com/flutter/flutter/issues/132690


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-08-21 15:54:26 -07:00
skia-flutter-autoroll
948ca1521d Roll Dart SDK from 1859f7202bba to 00f6f69187df (1 revision) (flutter/engine#44922)
https://dart.googlesource.com/sdk.git/+log/1859f7202bba..00f6f69187df

2023-08-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-94.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jsimmons@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 22:43:21 +00:00
godofredoc
54d7aeb6db Use arm64 machines for ios_debug_sim_arm64 test. (flutter/engine#44920)
The test is failing when running on a x64 machine and we are pinning this test to use arm64.

Bug: https://github.com/flutter/flutter/issues/132993

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-21 22:25:05 +00:00
skia-flutter-autoroll
964564d2b8 Roll Skia from ca891e495da1 to da6b74568ece (3 revisions) (flutter/engine#44917)
https://skia.googlesource.com/skia.git/+log/ca891e495da1..da6b74568ece

2023-08-21 lovisolo@google.com [bazel] Run Go tests with Bazel in CI.
2023-08-21 brianosman@google.com Increase default alpha tolerance in ImageAsyncReadPixels
2023-08-21 egdaniel@google.com [Graphite] Add support for sampling BottomLeft origin wrapped textures.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jsimmons@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 20:29:30 +00:00
Brian Osman
41be06b59f Include GrVkTypes where necessary (flutter/engine#44916)
IWYU fix to be able to use GrVkImageInfo. An incoming Skia change will otherwise fail to compile here.
2023-08-21 19:50:04 +00:00
godofredoc
04efc39b8a Remove explicit mac cpu dimensions (flutter/engine#44836)
Running builds and tests on x64 machines is causing long queue times even when there is plenty of arm64 machines. This PR is removing most of the cpu pinned dimensions and it is separating some of the test to global tests to allow to select x64 machines only for the tests part.
2023-08-21 19:31:58 +00:00
John McCutchan
55d598886f [Impeller] Initial Android Impeller docs on backend selection and platform views. (flutter/engine#44815)
Fixes https://github.com/flutter/flutter/issues/132716
2023-08-21 12:14:00 -07:00
skia-flutter-autoroll
73902d21ac Roll Skia from 7e5a3009a8d4 to da3bb89a5d88 (9 revisions) (flutter/engine#44906)
https://skia.googlesource.com/skia.git/+log/7e5a3009a8d4..da3bb89a5d88

2023-08-21 johnstiles@google.com Add extended option [wgsl=true] to enable WGSL in DM.
2023-08-21 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from aa121378c102 to c1234c5f930e (1 revision)
2023-08-21 jamesgk@google.com [graphite] Generate new mipmaps when copying mipmapped texture
2023-08-21 johnstiles@google.com Add Caps bit to enable WGSL code generator.
2023-08-21 ccameron@chromium.org SkXMLParser::parse: Optimize memory-backed streams
2023-08-21 johnstiles@google.com Move unneeded constants out of header.
2023-08-21 johnstiles@google.com Remove SK_ENABLE_SKSL.
2023-08-21 brianosman@google.com Remove GrBackendRenderTargetData::isValid
2023-08-21 johnstiles@google.com Remove unused argument from WGSL ctor functions.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jsimmons@google.com,lovisolo@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 18:06:05 +00:00
Zachary Anderson
c9f9d56adf Don't run clang_tidy --lint-all in presubmit (flutter/engine#44833)
Instead, this PR runs clang_tidy only on files that have been changed.

Related https://github.com/flutter/flutter/issues/105068
2023-08-21 17:51:10 +00:00
Greg Spencer
2bcecf60c9 Change Doxyfile options to not create subdirs (flutter/engine#44855)
## Description

This turns off the Doxyfile option `CREATE_SUBDIRS` because it prevents deep link URLs from being stable. It means that thousands of files will be in the main directory, but the filesystem should be able to handle that.

I got rid of the header/footer files for doxygen (because Doxygen will generate them anyhow) and fixed where it was looking for the Flutter logo.

I also ran Doxygen on the Doxyfile template and Doxyfile and updated all the options to correspond with the latest Doxygen.
2023-08-21 17:39:06 +00:00
Jonah Williams
9883398f4c [Impeller] Remove sync switch (flutter/engine#44885)
Adding back the waitUntilScheduled introduced a regression with this sync switch behavior. Because we block on all previous cmd buffer submission, if the sync switch fires partially through the raster thread workload, then some of our cmd buffers won't be submitted and waitUntilScheduled won't terminate.

But since we added back the waitUntilScheduled, we don't actually need these guards, as this ensures that the raster thread doesn't finish until all worker threads have finished.
2023-08-21 17:31:20 +00:00
skia-flutter-autoroll
8b1023ba27 Roll Skia from 475f07f5ca14 to 7e5a3009a8d4 (1 revision) (flutter/engine#44900)
https://skia.googlesource.com/skia.git/+log/475f07f5ca14..7e5a3009a8d4

2023-08-21 johnstiles@google.com Use unsigned chars in Lexer.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC armansito@google.com,brianosman@google.com,jsimmons@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 15:36:22 +00:00
Jim Graham
5774ccf84f Split DisplayListBuilder into DlCanvas optimizer and DlOp recorder classes (flutter/engine#44718)
DisplayListBuilder grew over time from a class that implemented a developer-unfriendly stateful API into one that implemented both the developer-friendly DlCanvas API as well as its original stateful API. Over time, the stateful API was buried under a "testing only" facade.

In the meantime, the optimization features that it applies to the DlCanvas calls before it records the operations in a DlOp store are useful without the recording process and so I've been wanting to break those into 2 parts for a while with the goal of removing all stateful APIs from DisplayListBuilder (see https://github.com/flutter/flutter/issues/108303).

This PR takes a major step along that direction by splitting DisplayListBuilder into essentially a convenience class that marries 2 new classes together to achieve its old functionality:
- `DlCanvasToReceiver` - a class that implements DlCanvas, optimizes common situations, and then sends commands to any object that implements `DlOpReceiver`
- `DlOpRecorder` - an implementation of DlOpReceiver that records the operations in a buffer from which to create a `DisplayList` object
- `DisplayListBuilder` now inherits from DlCanvasToReceiver to get the optimizations and provides it with an instance of `DlOpRecorder` as the receiver that it will send its results to
- Similarly, a `DlCanvasToReceiver` instance could be directed to an `impeller:DlDispatcher` to achieve a more straight-through path from the DlCanvas interface to impeller Pictures.
2023-08-21 07:17:19 +00:00
skia-flutter-autoroll
67876049a1 Roll Skia from d2369dac4a1d to fca8fac08117 (1 revision) (flutter/engine#44888)
https://skia.googlesource.com/skia.git/+log/d2369dac4a1d..fca8fac08117

2023-08-21 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Skia Infra from 228e9620e667 to 572e236a3608 (6 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC armansito@google.com,brianosman@google.com,jsimmons@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 05:49:30 +00:00
skia-flutter-autoroll
84297427ed Roll Dart SDK from 632c8cccd30c to c839eea7f0fa (1 revision) (flutter/engine#44886)
https://dart.googlesource.com/sdk.git/+log/632c8cccd30c..c839eea7f0fa

2023-08-19 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-90.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jsimmons@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-21 01:45:23 +00:00
skia-flutter-autoroll
25e5a6c9e8 Roll Skia from 4f6b9d08b6d1 to d2369dac4a1d (6 revisions) (flutter/engine#44883)
https://skia.googlesource.com/skia.git/+log/4f6b9d08b6d1..d2369dac4a1d

2023-08-20 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 86b1009b1e55 to aa121378c102 (1 revision)
2023-08-20 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from a8c25b53a106 to 86b1009b1e55 (1 revision)
2023-08-19 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from af77dd0a5da0 to a8c25b53a106 (1 revision)
2023-08-19 sunnyps@chromium.org graphite: Implement onReinterpretColorSpace for Image_YUVA
2023-08-18 scroggo@google.com SkQP bash scripts: use python3
2023-08-18 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2542ba0a2d7e to af77dd0a5da0 (6 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC armansito@google.com,brianosman@google.com,jsimmons@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-20 22:19:10 +00:00
Brandon DeRosier
d6ab095556 [Impeller] Fix clip management for DrawPicture. (flutter/engine#44835)
Solves two problems:
1. Fix the debug crash by restoring the clip after the `EntityPass`
merge. I initially surrounded the merge with a `Save` and `Restore`,
which was a mistake and is a no-op in this situation. This should have
no excess impact on performance, since we ignore clips in `EntityPass`
when we detect that they won't do anything.
2. Picture subpasses weren't getting their stencil depth adjusted during
the merge, which can result in subpass entities potentially receiving a
clip depth that's too high.
2023-08-20 15:03:11 -07:00
Chinmay Garde
6f57ec0293 [Impeller] Document threading configuration with Vulkan. (flutter/engine#44874)
Moving bits and pieces of the presentation this morning into docs so we can keep them up to date.
2023-08-20 21:36:00 +00:00
skia-flutter-autoroll
b5d9f17cee Roll Dart SDK from a4908f67b63e to 632c8cccd30c (2 revisions) (flutter/engine#44872)
https://dart.googlesource.com/sdk.git/+log/a4908f67b63e..632c8cccd30c

2023-08-19 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-89.0.dev
2023-08-18 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-88.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jsimmons@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-20 21:32:51 +00:00
skia-flutter-autoroll
034aaf2680 Roll Fuchsia Linux SDK from pSqQ556xmZp7S4np5... to iQbvLoFBbhU8pkkqw... (flutter/engine#44878)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-20 21:32:49 +00:00
skia-flutter-autoroll
ebfc7f9b33 Roll Skia from e9cf3f1740eb to 4f6b9d08b6d1 (2 revisions) (flutter/engine#44868)
https://skia.googlesource.com/skia.git/+log/e9cf3f1740eb..4f6b9d08b6d1

2023-08-18 johnstiles@google.com Add parentheses around ambiguous WGSL binary-op intrinsics.
2023-08-18 johnstiles@google.com Fix precedence level for WGSL ternary ops.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,egdaniel@google.com,jsimmons@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-08-20 21:31:35 +00:00