5095 Commits

Author SHA1 Message Date
Loïc Sharma
2526347a83 [Fuchsia] Assert renders are only to the implicit view (flutter/engine#51559)
Fuchsia does not support multiple view rendering yet. This asserts only the implicit view is rendered to, to mirror the existing Android and iOS assertion.

Prepares for:
1. https://github.com/flutter/flutter/issues/144806
1. https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-21 21:09:04 +00:00
Loïc Sharma
454af9a350 [Embedder API] Fix test helper's present callback registration (flutter/engine#51560)
https://github.com/flutter/engine/pull/51293 added a new present callback that supports multiple views. However, the test helper incorrectly inversed the single-view and multi-view present callbacks. This didn't affect the existing tests as we don't any multi-view tests yet.

Prepares for https://github.com/flutter/flutter/issues/144810

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-21 21:07:27 +00:00
Jason Simmons
762d37fd2e Move //buildtools to //flutter/buildtools (flutter/engine#51526) 2024-03-21 17:06:44 +00:00
K Lubick
95d17af1aa Migrate use of deprecated GrDirectContext::MakeMetal (flutter/engine#51537)
This was deprecated in https://skia-review.googlesource.com/c/skia/+/826397. Furthermore, some metal files were relocated, so this changes those also.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 18:07:33 +00:00
Gray Mackall
ee36c0eae0 Upgrade to gradle 8.3 (flutter/engine#51422)
Fixes https://github.com/flutter/flutter/issues/145165

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 17:26:35 +00:00
Gray Mackall
2e5a69f82c Add even more logging for UnsatisfiedLinkError (flutter/engine#51554)
follow up to https://github.com/flutter/engine/pull/51534#discussion_r1532301441

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 16:37:09 +00:00
Gray Mackall
156c44315f Add more logging for UnsatisfiedLinkError (flutter/engine#51534)
Add additional logging for this error, because there are still no local reproduction cases.

related to https://github.com/flutter/flutter/issues/144291

follow up to https://github.com/flutter/engine/pull/50247

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 15:34:05 +00:00
Victoria Ashworth
9f75a01caa Regenerate FlutterMacOS.xcframework when sources of dependencies change (flutter/engine#51396)
Fixes https://github.com/flutter/flutter/issues/144716.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-19 20:37:08 +00:00
Chinmay Garde
dcd175ecb5 Add missing license blocks. (flutter/engine#51496)
These are files that the license script ignores.
2024-03-18 20:47:23 -07:00
Loïc Sharma
21c9a731f0 [Embedder API] Remove view (flutter/engine#51400)
Adds `FlutterEngineRemoveView` to the embedder API. This will be used to destroy a view.

The embedder API does not allow embedders to create multiple views yet.

Design doc: https://flutter.dev/go/multi-view-embedder-apis

Part of https://github.com/flutter/flutter/issues/144806
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-18 18:23:22 +00:00
Jenn Magder
d30a412e28 Support accessibility back gesture to pop route from view controller (flutter/engine#51241)
Adapted suggestion from https://github.com/flutter/flutter/issues/74246#issuecomment-971326926 to pop the route if the view controller route if `accessibilityPerformEscape` is called at that level in the responder chain.

Ideally this could know if the route was successfully popped, and only then return `YES` (halting propagation through the responder chain).

I confirmed by editing https://docs.flutter.dev/cookbook/navigation/navigation-basics#interactive-example as a demo that that the two-finger scrub (move two fingers back and forth three times quickly, making a "z") navigates back to the last route, and that the [`SementicObject`](e889b287f1/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm (L763)) scrub, which already worked, continued to work.

I'm not super familiar with this code, hopefully there aren't further gotchas I'm not thinking of.

Fixes https://github.com/flutter/flutter/issues/74246

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-18 18:11:59 +00:00
Chinmay Garde
695a720ded Re-land "[Impeller] A toolkit for managed handles to Android NDK vended objects." (flutter/engine#51460)
This reverts commit 037aa6b4caa6a3a726e67e519324b2c0a1ec274a.

The original cause of the revert was a flake introduced because the unit-test could request a frame from the Choreographer if it ran long enough. The availability checks in the choreographer were inaccurate after we intentionally backed out of using the Callback32 variant on 32 bit platforms.

The new tests didn't catch it because of an unrelated issue. In the first version of the patch for review, the proc table was only supposed to run on API levels 29 and above. When @dnfield requested we also get rid of the NDK helpers, the choreographer and additional utilities were added. But the API level gate in the new test harness wasn't removed. This made the tests be skipped. That gate has been removed entirely now. The error that cause the revert because of flakiness will now be a reliable failure.
2024-03-16 00:15:07 +00:00
Loïc Sharma
2e10c04742 [Windows] Move to new present callback (flutter/engine#51293)
Migrates the Windows embedder to the new present callback which includes a `view_id` value.

Design doc: https://flutter.dev/go/multi-view-embedder-apis

Part of https://github.com/flutter/flutter/issues/144810
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-15 21:46:59 +00:00
auto-submit[bot]
037aa6b4ca Reverts "[Impeller] A toolkit for managed handles to Android NDK vended objects. (#51334)" (flutter/engine#51457)
Reverts: flutter/engine#51334
Initiated by: matanlurey
Reason for reverting: Broke engine post-submit, see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8753367119442265873/+/u/test:_Android_Unit_Tests__API_28_/stdout.
Original PR Author: chinmaygarde

Reviewed By: {dnfield}

This change reverts the following previous change:
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch.

Part of https://github.com/flutter/engine/pull/51213 being chopped up.
2024-03-15 21:35:37 +00:00
Chinmay Garde
38ec9b7328 [Impeller] A toolkit for managed handles to Android NDK vended objects. (flutter/engine#51334)
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch.

Part of https://github.com/flutter/engine/pull/51213 being chopped up.
2024-03-15 20:45:15 +00:00
Jim Graham
3942f01773 [DisplayList] Pre-Compute saveLayer bounds in DLBuilder (flutter/engine#50935)
Previously the DisplayListBuilder would only pass along bounds for a saveLayer when they were supplied by the caller that was building the DisplayList. This would require Impeller to use post-processing of the EntityPass lists to compute them on its own.

DisplayList can now compute those bounds as it builds the DisplayList to save dispatch clients from having to do so on their own. It will also provide an indicator in the case when the caller supplied bounds that ended up being too small to capture all of the content, causing clipping by the layer render target.
2024-03-15 17:45:05 +00:00
zijiehe@
fb4d1819e7 [Fuchsia] Remove the use of //build/ in fuchsia (flutter/engine#51072)
### Motivation of the change:

Both dart and flutter are using fairly outdated gn-sdk without properly maintained. Currently @hjfreyer is working on version'ed IDK / SDK libs which requires changes in gn-sdk to use the right version of the libs in fuchsia/sdk/obj/{arch}-api-{level} rather than the one in the fuchsia/sdk/arch. But current implementation does not support choosing the right version.

### Blocking issue:

The new gn-sdk (in flutter/tools/fuchsia/gn-sdk) generates multiple BUILD.gn files rather than a large BUILD.gn the previous version created. So most of the build rules need to switch from the old `fidl:{api}` build rule to `fidl/{api}` rule. The same change will happen in the dart/sdk, i.e. http://go/dart-reviews/356924. But since the two repos cannot have one single atomic change, changing either side first will cause flutter to break. E.g. the linkage error caused by duplicated symbols will happen if we change the dart/sdk first, since in flutter, it will still refer to the old build rules in the middle.

### Solutions:

Ideally we can create redirect rules in the current `build/fuchsia` buildroot tree to redirect the old rules into the new one, so we can make the change in the flutter first then dart/sdk. But creating the rules is not trivial and will only be used once.

So an alternative solution is

- pause the dart/sdk -> flutter roll
- submit dart/sdk change (http://go/dart-reviews/356924)
- update this change to manually bring the dart/sdk change, namely the `dart_revision` in the DEPS file and signatures in the ci/licences.
- resume the dart/sdk -> flutter roll.

But it requires this change itself to be reviewed first, and I'd like to know your opinion before moving forward.

See corresponding dart/sdk change at http://go/dart-reviews/356924.

### //build/fuchsia/ from buildroot should be removed after this change.

Bug: [b/40935282](https://issues.chromium.org/issues/40935282?pli=1&authuser=0)

FYI: @hjfreyer 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-15 02:52:21 +00:00
Matej Knopp
4bd6cb188b Fix flakiness in FlutterVSyncWaiterTest.VSyncWorks and FlutterDisplayLinkTest.WorkaroundForFB13482573 (flutter/engine#51405)
- Removes potential source of flakiness where the tests assumes that
scheduled block will be performed within certain time period, which,
despite the tolerances may not be the case on test runner.

- Ensures that `viewDidChangeWindow` notification is not received while
invalidating the displayLink and removing the display link view, which
could deadlock at the end of `WorkaroundForFB13482573` test because the
notification would come while `FlutterDisplayLink` is in `@synchronized`
block.

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-14 22:00:34 +01:00
Loïc Sharma
fbfbc4393f [Embedder API] Add multi-view present callback (flutter/engine#51267)
Adds `FlutterCompositor.present_view_callback` to the embedder API. This new present callback adds a `view_id` member to allow embedders know which view is being presented.

The embedder API does not allow embedders to create multiple views yet. This will be added in a future  pull request.

Design doc: https://flutter.dev/go/multi-view-embedder-apis

Pull request that migrates the Windows embedder to this new embedder API: https://github.com/flutter/engine/pull/51293

Part of https://github.com/flutter/flutter/issues/144806
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-14 00:22:22 +00:00
Tong Mu
ba26f6ee8b Multi-view View Metrics (flutter/engine#46174)
This PR adds `FlutterWindowMetricsEvent.viewId` to the embedder API.

This PR only tests the ability to send metrics event for the implicit
view. Once multiple views can be added via embedder API, we should test
the ability to send different IDs.

Part of https://github.com/flutter/flutter/issues/144806
Part of https://github.com/flutter/flutter/issues/142845

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [ ] 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-13 17:00:17 -07:00
John McCutchan
2520e4615c Disable cleaning up ImageReaders in memory pressure callback (flutter/engine#51391)
We originally added this cleanup code to work around a Samsung-specific
Android 14 bug where after resuming an application any ImageReaders are
busted. According to the Android team what Samsung is doing is a
violation of the "spec".

The fix ended up breaking VirtualDisplay platform views after a
suspend/resume because the surface we pass to the VirtualDisplay is no
longer valid after the resume and we have no way of fixing that.

This PR removes the Samsung-specific hacky fix, restoring the behaviour
of VirtualDisplay backed platform views.

We have an internal bug with Samsung to address the root cause.
2024-03-13 15:40:11 -07:00
Matej Knopp
9fac4c3db6 Reland "Reland: [macOS] Use CVDisplayLink to drive repaint" (flutter/engine#51210)
[Original reland](https://github.com/flutter/engine/pull/51126) was
[reverted](f29d809efb)
because of skiaperf regressions. The regressions are caused by runner
machines running display at 30hz.

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-13 19:20:16 +01:00
Jonah Williams
0cdb8526d2 [Impeller] fix heap selection process for YUV textures. (flutter/engine#51262)
This does not fix the emulator weirdness!

Today we automatically select the first memory type index requested by an AHB. The device in question may lack that memory type index, so we can then fail to import the AHB. Additionally, if we do fail we need to ensure that we don't attempt to display the texture.
2024-03-13 18:18:48 +00:00
zijiehe@
224b7f08ff [Fuchsia] Enable sound null safety everywhere (flutter/engine#51355)
This change enables null_safety on fuchsia everywhere and remove the legacy conditions.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-13 17:56:05 +00:00
Chinmay Garde
6a151f5c40 [Impeller] Make masks type safe. (flutter/engine#51369)
Uses the utility added in https://github.com/flutter/engine/pull/51361

I counted the removal of 58 static casts. There was one addition made to the original utility however. Vulkan HPP was promoting all enums to its own mask type. This in itself is problematic but we got away with it because there was no one else doing this kind of promotion. Till we added our own utility. To avoid polluting the namespace with methods that may cause ambiguity, enums that are masks must explicitly be marked as maskable with `IMPELLER_ENUM_IS_MASK` in the `impeller` namespace.

No change in functionality.
2024-03-13 00:12:21 +00:00
Loïc Sharma
b2f119de6b [dart:ui] Add view ID to PointerData.toString (flutter/engine#51352)
The `view_id` is useful information as the pointer's `x` and `y` coordinates are relative to the view's origin.

Part of https://github.com/flutter/flutter/issues/112205
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-12 21:53:41 +00:00
utzcoz
30ce58dc55 Bump Robolectric to 4.11.1 (flutter/engine#51310)
Bump Robolectric to the latest stable 4.11.1.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-11 07:47:21 +00:00
Zachary Anderson
0b18c484ac Explicitly list Android embedding dependency jars in GN (flutter/engine#51303)
Part of https://github.com/flutter/flutter/issues/144430.

From `gn help inputs`: "It may be tempting to write a script that
enumerates all files in a directory
  as inputs. Don't do this!"
2024-03-09 12:02:46 -08:00
Chinmay Garde
dfb7d84ab8 [Impeller] Use the AHB prefix for utils that work with Android Hardware Buffers. (flutter/engine#51298)
Also doesn't compile the TU on non-Android platforms.

Part of https://github.com/flutter/engine/pull/51213 being chopped up.

No change in functionality. Just renames and moves stuff around.
2024-03-09 00:52:25 +00:00
Justin McCandless
3a07dc741a iPad keyboard cut/copy/paste buttons (flutter/engine#50923)
The cut/copy/paste buttons above the keyboard on iPad were previously always greyed out, but now they work.
2024-03-08 13:30:50 -08:00
Dan Field
a4c787e072 Use io.flutter.Build.API_LEVELS rather than android.os.Build.VERSION_CODES (flutter/engine#51171)
Updates the linting script to ban the use of `VERSION_CODES`.

We currently have a mish-mash of using the integers, using `VERSION_CODES`, and even how we import the version codes. This makes it more confusing when doing things like #51070 - I think it is clearer to see `22` than `LOLLIPOP_MR1`.

I'd like to get LGTM (or at least no opinion) from all the requested reviewers here.
2024-03-08 19:04:20 +00:00
Chris Bracken
0575633c34 Move ANGLE to flutter/third_party (flutter/engine#51270)
This moves Flutter out of the buildroot's third_party directory and into
//flutter/third_party and updates all BUILD and gni files.

Issue: https://github.com/flutter/flutter/issues/144786
Part of: https://github.com/flutter/flutter/issues/67373

## 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 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] The odds of this passing on its first CI run is 0%, because
there's no way the licence script isn't going to have a fit over it, at
which point I promise on my honour that I will dutifully fix all the
things it complains about and re-run, probably more than once.
- [X] This PR fulfils the minimum [Canadian
Content](https://www.youtube.com/watch?v=h9NMnPm5kXc&list=PLJ7QPuvv91JuoPWrLhqX0zDFUoLdynMEk&index=3)
regulations mandated by the CRTC.
- [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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-07 16:23:14 -08:00
Loïc Sharma
ece178965b [Windows] Allow plugins to get views (flutter/engine#51096)
Allow Flutter Windows plugins to get views by their ID.

Design doc: https://flutter.dev/go/desktop-multi-view-runner-apis

Part of https://github.com/flutter/flutter/issues/143767
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-06 21:19:19 +00:00
Zachary Anderson
2fdc3293eb Disable flaky linux desktop test (flutter/engine#51231)
For https://github.com/flutter/flutter/issues/138197
2024-03-06 20:27:00 +00:00
Chinmay Garde
db4a60e675 [Impeller] Implement YUV texture import and sampling for video player frames. (flutter/engine#50730)
This patch rounds out support for importing Android Hardware Buffers as Vulkan
images and sampling from them.

Not all Android Hardware Buffers are in formats that Vulkan (let alone Impeller)
understands. Some YUV textures have formats with no equivalent `vk::Format` enum
and need extra information on how to sample from them.

This patch adds support for correctly importing and sampling from such formats.

There are severe restrictions on how sampling from such external formats works.
For one, it isn’t possible to assign a combined image sampler in the render
pass. The pipeline itself needs to be rebuilt to reference a specially created
immutable sampler. This immutable sampler is a combination of the usual
information present in an Impeller SamplerDescriptor as well as a custom
“conversion” object obtained while importing the Android Hardware Buffer.

There is no way to predict what conversion object will be necessary ahead of
time as this will depend on the source of the Android Hardware Buffers and is
likely different for different video feeds, camera sources, and other Android
Hardware Buffer texture sources.

To handle this uncertainty, a new pipeline variant with a JIT determined
immutable sampler will be hashed and cached before being used in a render pass.
The number of pipeline variants created just-in-time will depend on the number
of sampler variants used in the render pass to sample from wrapped Image. For
instance, specifying a sampler with a different address mode will likely result
in a new pipeline variant being created.

In most cases however, there will just be one or two additional pipeline
variants per application. Impellers sampler diversity is very low with most
samplers being the usual NN samplers. It may be possible to preload even this
pipeline by trying known conversions. As said previously, there can only be a
handful of these conversions.

More restrictions on sampling from such images includes being limited to
`VK_FILTER_LINEAR` without additional format and extension wrangling and
performance penalties.

Fixes https://github.com/flutter/flutter/issues/142082.
2024-03-05 12:42:51 -08:00
auto-submit[bot]
f29d809efb Reverts "Reland: [macOS] Use CVDisplayLink to drive repaint (#51126)" (flutter/engine#51192)
Reverts flutter/engine#51126
Initiated by: cbracken
Reason for reverting: looks like this regressed Skia benchmarks: https://flutter-flutter-perf.skia.org/e/?keys=Xbf8dce9c233bce34d20e2280e3f1d8db&selected=commit%3D39653%26name%3D%2Carch%3Dintel%2Cbranch%3Dmaster%2Cconfig%3Ddefault%2Cdevice_type%3Dnone%2Cdevice_version%3Dnone%2Chost_type%3Dmac%2Csub_result%3DtimeToFirstFrameRasterizedMicros%2Ctest%3Dflutter_gallery_macos__start_up%2C&xbaroffset=39569

The regression s
Original PR Author: knopp

Reviewed By: {cbracken}

This change reverts the following previous change:
Original Description:
This relands the PR reverted in https://github.com/flutter/engine/pull/51095

Changes since the original PR:
- The macOS embedder does not assume particular clock when calling the embedder API, but converts CAMediaTime to engine time and back (`FlutterTimeConverter`)
- `FlutterVSyncWaiter` does not wait for displaylink callback during warmup frame. This should prevent `timeToFirstFrameRasterizedMicros` regressions.
- When enforcing frame pacing the raster thread is not blocked. This should prevent `average_frame_rasterizer_time_millis` regressions.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-05 03:25:18 +00:00
Miguel
1b88c55bc7 [fuchsia] Remove now unnecessary diagnostics directory (flutter/engine#51180)
Inspect is now published using InspectSink and we can get rid of this
directory.

I'm unsure what "debug" and "ctrl" are for so I left them untouched.

Bug: https://g-issues.fuchsia.dev/issues/320785253

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-05 03:03:50 +01:00
Gray Mackall
879a9147d9 [Re-land] Remove WindowManager reflection in SingleViewPresentation.java (flutter/engine#50890)
relands https://github.com/flutter/engine/pull/49996

Context b/326363243

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-04 23:49:38 +00:00
Ian McKellar
0ae34f2e93 [fuchsia] Prepare for @transitional removal (flutter/engine#51185)
Bug: https://fxbug.dev/42078310
2024-03-04 15:44:24 -08:00
Matej Knopp
ac9586994e Reland: [macOS] Use CVDisplayLink to drive repaint (flutter/engine#51126)
This relands the PR reverted in
https://github.com/flutter/engine/pull/51095

Changes since the original PR:
- The macOS embedder does not assume particular clock when calling the
embedder API, but converts CAMediaTime to engine time and back
(`FlutterTimeConverter`)
- `FlutterVSyncWaiter` does not wait for displaylink callback during
warmup frame. This should prevent `timeToFirstFrameRasterizedMicros`
regressions.
- When enforcing frame pacing the raster thread is not blocked. This
should prevent `average_frame_rasterizer_time_millis` regressions.

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-03-04 21:57:45 +01:00
Dan Field
19296c0ffd Guard against API 22 (flutter/engine#51167)
This was introduced in #51070 - my grepping for `LOLLIPOP` was too aggressive, and apparently the linter didn't catch this. I think it's just a bug in the linter.

Fixes b/327717572, because Google internal tests caught this.
2024-03-04 18:40:19 +00:00
Robert Ancell
614df9461d Fix custom FlValue API not being exported (flutter/engine#51154)
Would fail to link when using it in a Flutter app.
2024-03-04 15:05:41 +13:00
Gray Mackall
dde1849f04 Add instructions for getting code coverage in Android Studio (flutter/engine#51105)
small readme change, because for whatever reason we need to apply the comment from this hero https://github.com/robolectric/robolectric/issues/3023#issuecomment-1326870713 to make code coverage work 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-01 00:02:29 +00:00
Robert Ancell
fc560d4bc2 Refactor GL rendering to prepare for GTK4 (flutter/engine#50754)
Refactor GL rendering to prepare for GTK4    
- Remove FlGLArea - we can just use GtkGLArea directly
- Stop using gdk_cairo_draw_from_gl, it's not available in GTK4.
- Rename FlRendererGL to FlRendererGdk, this was implying that
FlRenderer could be something other than OpenGL which is not the case
currently.
- Remove unnecessary virtual methods in FlRenderer, just implement them
as standard methods.

Related: https://github.com/flutter/flutter/issues/143408
2024-03-01 10:24:11 +13:00
Matej Knopp
0d3941630d Revert "[macOS] Use CVDisplayLink to drive repaint (#49159)" (flutter/engine#51095)
The original PR assumed that `fml::TimePoint` has same base as
`CACurrentMediaTime()`. However due to recent change in Dart SDK that's
no longer true. Dart SDK
[replaced](https://dart-review.googlesource.com/c/sdk/+/348044?tab=comments)
call to `mach_absolute_time` with
`clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)`, while
`CACurrentMediaTime()` corresponds to `CLOCK_UPTIME_RAW`.

This needs to be fixed either in Dart SDK
https://github.com/dart-lang/sdk/issues/55071 or the original PR needs
to be relanded with appropriate conversions.

This reverts commit 8ff01af723be83ab019b0ddf7d64d8586d280186.

*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR. You must list at least one
issue.*

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-02-29 12:39:33 -08:00
Dan Field
2e9e6107eb Reapply "Bump everything to Android 21" (#51056) (flutter/engine#51070)
This reverts commit 98485b3f82fec45a6a0ac932c3c20285a9a14e02.

Reverted in https://github.com/flutter/engine/pull/51056 because it
caused failures in the framework. No changes, but framework test has
been updated to use an actual robolectric implementation to avoid those
failures.

This should not land until
https://github.com/flutter/flutter/pull/144348 has landed in the
framework.

@gaaclarke @johnmccutchan fyi
2024-02-29 09:00:01 -08:00
Loïc Sharma
461cf83c58 [Windows] Add view ID runner APIs (flutter/engine#51020)
Allow Flutter Windows apps and plugins to get the view's ID.

Design doc: https://flutter.dev/go/desktop-multi-view-runner-apis

Part of https://github.com/flutter/flutter/issues/143767
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-29 16:22:39 +00:00
Robert Ancell
da5550db7f Update Linux embedder to latest semantics API (flutter/engine#51030)
Change to the latest semantics API and remove an unused class.
2024-02-29 15:18:19 +13:00
Jonah Williams
65f3a2348b [Impeller] switch fallback default from ImpellerVulkan to SkiaOpenGLES (flutter/engine#51071)
Unblocks shipping Impeller on Android before GLES is ready.
2024-02-29 01:47:19 +00:00
Matan Lurey
bc4d5caa20 Test the SurfaceTextureSurfaceProducer-branch in the Android scenario_app (flutter/engine#51061)
This PR does the following:
- Relands https://github.com/flutter/engine/pull/50993.
- Fixes a bug in `SurfaceTextureSurfaceProducer` where it would crash on
release (now tested, yay!)

Closes https://github.com/flutter/flutter/issues/143539.
Closes https://github.com/flutter/flutter/issues/143483.

/cc @gaaclarke @chinmaygarde, this PR should (after landed) test/verify
https://github.com/flutter/engine/pull/50730.
2024-02-28 14:17:21 -08:00