6208 Commits

Author SHA1 Message Date
auto-submit[bot]
a8961f9449 Reverts "[fuchsia] Remove pm use in build_fuchsia_artifacts (#55832)" (flutter/engine#55922)
Reverts: flutter/engine#55832
Initiated by: zijiehe-google-com
Reason for reverting: may break roller.
Original PR Author: zijiehe-google-com

Reviewed By: {jrwang}

This change reverts the following previous change:
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.

Also the use of pm in build_fuchsia_artifacts.py is removed as the placements of the binaries changed.
https://github.com/flutter/engine/pull/55445 was a previous attempt and it generates [a malformatted cipd](https://chrome-infra-packages.appspot.com/p/flutter/fuchsia/+/vU1Op26qgO5XYs9S8AqQMvBwgITD9hq3-2dIu2H5-iwC).

Bug: http://b/353729557, http://b/368608542

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-17 01:12:46 +00:00
auto-submit[bot]
0e1b2a9058 Reverts "Manual roll Dart SDK from d916a5f69a48 to 2bf0f2b8d391 (24 revisions) (#55884)" (flutter/engine#55915)
Reverts: flutter/engine#55884
Initiated by: zanderso
Reason for reverting: b/373907578
Original PR Author: a-siva

Reviewed By: {srawlins, zanderso}

This change reverts the following previous change:
Manual roll requested by [asiva@google.com](mailto:asiva@google.com)

https://dart.googlesource.com/sdk.git/+log/d916a5f69a48..2bf0f2b8d391

2024-10-15 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-23.0.dev
2024-10-14 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-22.0.dev
2024-10-14 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-21.0.dev
2024-10-14 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-20.0.dev
2024-10-12 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-19.0.dev
2024-10-12 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-18.0.dev
2024-10-12 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-17.0.dev
2024-10-12 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-16.0.dev
2024-10-11 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-15.0.dev
2024-10-11 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-14.0.dev
2024-10-11 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-13.0.dev
2024-10-11 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-12.0.dev
2024-10-10 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-11.0.dev
2024-10-10 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-10.0.dev
2024-10-10 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-9.0.dev
2024-10-10 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-8.0.dev
2024-10-10 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-7.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-6.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-5.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-4.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-3.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-2.0.dev
2024-10-09 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-1.0.dev
2024-10-08 [dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com) Version 3.7.0-0.0.dev
2024-10-16 21:13:46 +00:00
zijiehe@
ccea3b80cc [fuchsia] Remove pm use in build_fuchsia_artifacts (flutter/engine#55832)
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.

Also the use of pm in build_fuchsia_artifacts.py is removed as the placements of the binaries changed.
https://github.com/flutter/engine/pull/55445 was a previous attempt and it generates [a malformatted cipd](https://chrome-infra-packages.appspot.com/p/flutter/fuchsia/+/vU1Op26qgO5XYs9S8AqQMvBwgITD9hq3-2dIu2H5-iwC).

Bug: http://b/353729557, http://b/368608542

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-16 17:55:12 +00:00
Robert Ancell
2ccc210029 Remove obsolete fl_keyboard_view_delegate_get_messenger (flutter/engine#54857)
This is unnecessary - we already have the messenger.
2024-10-16 14:53:27 +13:00
Siva
f19aaeb32d Manual roll Dart SDK from d916a5f69a48 to 2bf0f2b8d391 (24 revisions) (flutter/engine#55884)
Manual roll requested by [asiva@google.com](mailto:asiva@google.com)

https://dart.googlesource.com/sdk.git/+log/d916a5f69a48..2bf0f2b8d391

2024-10-15
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-23.0.dev
2024-10-14
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-22.0.dev
2024-10-14
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-21.0.dev
2024-10-14
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-20.0.dev
2024-10-12
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-19.0.dev
2024-10-12
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-18.0.dev
2024-10-12
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-17.0.dev
2024-10-12
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-16.0.dev
2024-10-11
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-15.0.dev
2024-10-11
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-14.0.dev
2024-10-11
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-13.0.dev
2024-10-11
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-12.0.dev
2024-10-10
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-11.0.dev
2024-10-10
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-10.0.dev
2024-10-10
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-9.0.dev
2024-10-10
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-8.0.dev
2024-10-10
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-7.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-6.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-5.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-4.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-3.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-2.0.dev
2024-10-09
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-1.0.dev
2024-10-08
[dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com](mailto:dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com)
Version 3.7.0-0.0.dev

---------

Co-authored-by: skia-flutter-autoroll <skia-flutter-autoroll@skia.org>
2024-10-15 18:37:05 -07:00
Robert Ancell
6203c3e0f3 Split FlKeyboardManager out of FlKeyboardHandler (flutter/engine#55892)
They continue to share a FlKeyboardViewDelegate, but this will be split
too in a later change as part of moving these classes from FlView to
FlEngine.
2024-10-16 13:26:42 +13:00
hellohuanlin
9a685756f9 Revert "[ios][platform_view] Fix Platform view gesture recognizer wit… (flutter/engine#55889)
…h iPad pencil getting stuck (#55724)"

This reverts commit 21eb44914c22761f3c8bdb39b1d36b2fc15bde3b.

Revert since a customer reported the platform view touch is broken after the change. 

*List which issues are fixed by this PR. You must list at least one issue.*
Reopens https://github.com/flutter/engine/pull/55724

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-16 00:04:32 +00:00
Robert Ancell
db1e63b948 Simplify code for dispatching events (flutter/engine#55871) 2024-10-16 10:00:34 +13:00
Chinmay Garde
6be577d05a [Impeller] Ignore opt-outs on iOS devices. (flutter/engine#55808)
Addresses https://github.com/flutter/flutter/issues/155541

This does **not** remove Skia itself from the build. I'll stage that in a followup. Want to keep the scope of this patch small.

This is the new behavior:

* Impeller is the default on iOS devices **and** simulators.
* On iOS devices **only**, all flags and plist options are ignored.
* On iOS simulators **only**, Flutter will used Impeller's Metal backend by default and fallback to the Null backend if Metal device access is not available.
* On iOS simulators **only**, Flutter can pick Skia using the command line flags or plist flags. This is to allow users one more month to migrate as communicated by @zanderso.

The settings objects `enable_impeller` field is now `static constexpr` to avoid accidentally disabling the flag while it still exists.
2024-10-15 19:14:23 +00:00
Robert Ancell
0388529ef9 Use GWeakRef API (flutter/engine#55795)
For consistency with other code.
2024-10-14 14:36:37 +13:00
Robert Ancell
e0daa80cb2 Remove unnecessary use of std::vector (flutter/engine#55796) 2024-10-14 13:57:12 +13:00
Robert Ancell
7790182059 Remove fl_keyboard_view_delegate_subscribe_to_layout_change and just access the object directly via a method (flutter/engine#55817)
A step on the way to get FlKeyboardHandler out of FlView and into
FlEngine.
2024-10-14 13:54:05 +13:00
Robert Ancell
24ceeac432 Split out FlKeyboardLayout into its own class (flutter/engine#55816) 2024-10-14 12:07:26 +13:00
Robert Ancell
b9db87f8ac When rendering into secondary views, copy the pixel contents between contexts (flutter/engine#55639)
This is because GTK3 can't share contexts between GtkGLAreas.

We may be able to avoid the copy using the GL_OES_EGL_image or
GL_OES_EGL_image_external extensions.

Note that keyboard input doesn't work on the secondary view, this
requires moving the keyboard handling from FlView to FlEngine. Proposing
this now as a step forwards, but not yet useful for real applications.
2024-10-14 12:05:12 +13:00
Robert Ancell
b857ade17e Make FlRenderable interface (flutter/engine#55763)
Added to make testing of FlRenderer easier.
2024-10-14 10:30:41 +13:00
Robert Ancell
e5ecdd9c94 Fix dispose methods that didn't chain the parent. (flutter/engine#55794)
Remove empty dispose methods and convert finalize methods to dispose for
consistency.
2024-10-14 09:40:47 +13:00
Jim Graham
9e747c2eb6 Delete last usages of MockCanvas test mechanism (flutter/engine#55840)
The MockCanvas API was originally used to test the output of rendering methods to match them against a reference set of "MockData" structures. This API has been superseded by just using a DisplayListBuilder to record reference operations and then to compare the resulting DisplayList objects.

This PR deletes the last remaining uses of MockCanvas as well as the mechanism itself.
2024-10-12 05:15:17 +00:00
auto-submit[bot]
205b056c01 Reverts "[Fuchsia] Use more high level fuchsia-gn-sdk templates (#55445)" (flutter/engine#55834)
Reverts: flutter/engine#55445
Initiated by: zijiehe-google-com
Reason for reverting: This change would break the build_fuchsia_artifacts.py without https://github.com/flutter/engine/pull/55832/files. I'd merge two into one.
Original PR Author: zijiehe-google-com

Reviewed By: {jrwang}

This change reverts the following previous change:
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.

The build_fuchsia_artifacts.py is still using pm, and it will be handled in a following change.

Bug: http://b/353729557, http://b/368608542

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-11 17:51:47 +00:00
zijiehe@
297cf4be72 [Fuchsia] Use more high level fuchsia-gn-sdk templates (flutter/engine#55445)
This change removes the in-house built pm-based build rules in favor of
the high level fuchsia_component / fuchsia_package in the gn-sdk.

The build_fuchsia_artifacts.py is still using pm, and it will be handled
in a following change.

Bug: http://b/353729557, http://b/368608542

## 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-10-11 08:41:35 -07:00
hellohuanlin
21eb44914c [ios][platform_view] Fix Platform view gesture recognizer with iPad pencil getting stuck (flutter/engine#55724)
## Summary 

I came across our the "gesture recognizer delegate" implementation and it is quite odd (see below). After fixing it, the problem is resolved. However, it's hard to reason about how it's related to iPad pencil, since it's internal logic that we don't know (see my research below). 

## Gesture recognizer delegate

### Existing odd implementation

- shouldBeRequiredToFailByGestureRecognizer: 

`otherGestureRecognizer != self` is always YES because the delegate set to self, hence `gestureRecognizer` must be self, hence `otherGestureRecognizer` must not be self. 

- shouldRequireFailureOfGestureRecognizer: 

`otherGestureRecognizer == self` is always NO, for the same reason described above. 

### new implementation: 

After digging into various PRs, the idea seems to be that we want to have a precedence of "Forwarding recognizer >  Delaying recognizer > Other recognizers in platform view". 

- shouldBeRequiredToFailByGestureRecognizer:

`return otherGestureRecognizer != _forwardingRecognizer` means Delaying recognizer needs to be higher precedence than all non-Forwarding recognizer. (aka "Delaying recognizer > Other recognizers in platform view")

- shouldRequireFailureOfGestureRecognizer:

`return otherGestureRecognizer == _forwardingRecognizer` means Delaying recognizer needs to have lower precedence than forwarding recognizer. (aka "Forwarding recognizer > Delaying recognizer"). 

## Some research

This is a tricky one since pencil and finger triggers exactly the same callbacks. It turns out that when pencil is involved after finger interaction, the platform view's "forwarding" gesture recognizer is stuck at failed state. This seems to be an iOS bug, because according to [the API doc](https://developer.apple.com/documentation/uikit/uigesturerecognizerstate/uigesturerecognizerstatefailed?language=objc), it should be reset back to "possible" state:

> No action message is sent and the gesture recognizer is reset to [UIGestureRecognizerStatePossible](https://developer.apple.com/documentation/uikit/uigesturerecognizerstate/uigesturerecognizerstatepossible?language=objc).

However, when iPad pencil is involved, the state is not reset. I tried to KVO the state property, and wasn't able to capture the change. This means the state change very likely happened internally within the recognizer via the backing ivar of the state property.

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

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

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-11 02:24:43 +00:00
Jim Graham
3f0d57e071 [DisplayList] Create DlFoo type variants to start moving away from Skia types in API (flutter/engine#55812)
This is the beginning of the bulk of de-skia-fication work in the engine. All of the standard types in the DlCanvas API now have overloads that specify the corresponding Dl type, mainly for Dl*Rect and DlPoint types. This enables further work to switch from SkFoo types to DlFoo types in the various engine modules culminating in the elimination of the old methods that use the Sk types.

All of the former methods that used the basic Sk types are now implemented as inlinable translation overloads and the underlying implementations of DlCanvas now implement only the newer style interfaces so that they don't need to be further modified as we eliminate the old Skia types from the interface.

There are still a couple of Skia types remaining in the DlCanvas API without any DL type variants which will be handled in a future phase:
- SkRRect
- SkRSXform
- SkTextBlob (will be hidden behind a common interface along with TextFrame)
- SkImageInfo (only used in a few calling sites)
2024-10-11 00:42:23 +00:00
Jonah Williams
a8a7d1db42 [engine] remove merge thread setting and fix default value. (flutter/engine#55810)
When I removed the configration, I neglected the line that overrode the default from settings. This opted everyone back out. :(
2024-10-10 23:21:40 +00:00
Matan Lurey
d62fed45f7 Rename GetTargetRenderPassDescriptor to GetRenderTarget. (flutter/engine#55765)
Closes https://github.com/flutter/flutter/issues/154799.
2024-10-09 15:44:41 +00:00
Matan Lurey
8e3b58f166 ReleaseonTrimMemoryListener after ImageReaderSurfaceProducer released. (flutter/engine#55760)
Fixes https://github.com/flutter/flutter/issues/156434.

A better fix for the workaround in https://github.com/flutter/flutter/issues/156158.

This should likely be cherrypicked, as it's a memory leak, safe, and avoids workaround code in plugins.
2024-10-09 01:35:17 +00:00
Jonah Williams
086e6a63f5 [Impeller] remove Vulkan command encoder abstraction, use command buffer vk. (flutter/engine#55680)
The Vulkan command buffer wrapper delegates almost all of its functionality to the "CommandEncoderVK". I did not find that this separation was useful, as they have a 1-1 relationship and an identical lifecycle. Lets combine them to reduce the number of things to worry about.
2024-10-07 19:52:55 +00:00
Chris Bracken
773c37ab82 Revert "iOS: Migrate FlutterEngine to ARC (#55590)" (flutter/engine#55699)
Causing flakes on the _Mac mac_unopt (Cocoon)_ shard.

This reverts commit a2ac734e10115547d8c8ef34610ea6172e3cc98b.

Issue: https://github.com/flutter/flutter/issues/156177

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-07 16:29:24 +00:00
Jonah Williams
9d8929af60 [Impeller] generate mipmaps for toImage. (flutter/engine#55655)
Fixes https://github.com/flutter/flutter/issues/156161

Mips must be eagerly generated for Picture.toImage and friends so that filter quality (mip sampling) works as expected.
2024-10-04 17:49:55 +00:00
Chris Bracken
a2ac734e10 iOS: Migrate FlutterEngine to ARC (flutter/engine#55590)
Migrates `FlutterEnging` from manual reference counting to ARC. Migrates properties from `retain` to strong and `assign` to `weak` (where referencing an Obj-C object).

No semantic changes, therefore no changes to tests.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-04 15:00:30 +00:00
Jonah Williams
1cdd8d06be [Impeller] remove aiks color_source. (flutter/engine#55603)
Aiks color source is more or less a one to one copy of the impeller::DisplayListColorSource. We can rip it out, instead of flutter::DisplayList::ColorSource -> impeller::Aiks::ColorSource -> impelller:Entity::ColorSourceContents, just go directly flutter::DisplayList::ColorSource -> impelller:Entity::ColorSourceContents.

Part of https://github.com/flutter/flutter/issues/142054
2024-10-04 02:20:33 +00:00
Robert Ancell
971dbd79fb Refactor FlKeyboardHandler (flutter/engine#55601)
Refactor FlKeyboardHandler to be more GObject and less C++.

Done as we will need to move the handler from FlView to FlEngine to
support multi-view.
2024-10-04 12:00:00 +13:00
Jonah Williams
0854e45692 [Impeller] ensure one AiksContext per app. (flutter/engine#55629)
Reland of https://github.com/flutter/engine/pull/55393
2024-10-03 20:54:04 +00:00
Chris Bracken
36078b8126 iOS: Fix IOSSurfaceNoopTest (flutter/engine#55621)
Previously, we were passing `nullptr` to the `IOSSurfaceNoop` constructor:
56d060d501/shell/platform/darwin/ios/ios_surface_noop.mm (L23-L24)

which calls the IOSSurface constructor:
56d060d501/shell/platform/darwin/ios/ios_surface.mm (L55-L58)

Which calls `FML_DCHECK(ios_context_)`, which really doesn't like it when `ios_context_` is null.

I will later follow up with the next question of... "what exactly is going on with our CI here?", but this unbreaks my local dev testing workflow for the moment :)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-03 19:22:09 +00:00
auto-submit[bot]
5215356e5a Reverts "[Impeller] one aiks context per app. (#55393)" (flutter/engine#55625)
Reverts: flutter/engine#55393
Initiated by: matanlurey
Reason for reverting: Postsubmit turned red (clang tidy and build).
Original PR Author: jonahwilliams

Reviewed By: {chinmaygarde}

This change reverts the following previous change:
Hoist the content context up to the ios_surface so that overlay layers don't recreate a bunch of expensive machinery. 

Fixes https://github.com/flutter/flutter/issues/154836
2024-10-03 18:46:46 +00:00
Jonah Williams
7bb85d3d81 [Impeller] one aiks context per app. (flutter/engine#55393)
Hoist the content context up to the ios_surface so that overlay layers don't recreate a bunch of expensive machinery. 

Fixes https://github.com/flutter/flutter/issues/154836
2024-10-03 18:13:08 +00:00
Jonah Williams
192939c3a6 [impeller] merge aiks directory into impeller/display_list directory. (flutter/engine#55471)
Aiks has been gutted, and most of the reming types need to be merged with dl/entity types and deleted. this is difficult to do with impeller/display_list and aiks as separate gn targets as it requires circular deps.

Lets merge them and remove the aiks directory.
2024-10-02 19:07:57 +00:00
Chris Bracken
86626a85fb iOS: Migrate accessibility_bridge to ARC (flutter/engine#55570)
Keeps fml::scoped_* wrappers used in C++ class declarations in headers, since those are injected into both ARC and non-ARC translation units and these classes are ARC-safe. Once we've migrated all users of those headers to ARC, we can use the underlying classes directly.

No semantic changes, therefore not changes to tests.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-02 15:51:54 +00:00
Chris Bracken
67060c415c iOS: Migrate FlutterPlatformPlugin to ARC (flutter/engine#55571)
Migrates from manual reference counting to automatic reference counting. Migrates ivars to property syntax. Makes a minor update to a doc comment.

No semantic changes, therefore not changes to tests.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-01 23:23:57 +00:00
Robert Ancell
788cdbe3be Deregister views when they are destroyed (flutter/engine#55542) 2024-10-02 10:00:33 +13:00
Robert Ancell
166590d6c2 Allocate a view ID for secondary views (flutter/engine#55541)
Allocate view IDs for secondary Flutter views - another step towards
full multi-view support.
2024-10-02 09:04:31 +13:00
Chris Bracken
219d952197 iOS: Migrate FlutterEngineGroup to ARC (flutter/engine#55503)
This migrates FlutterEngineGroup to automatic reference counting. It also migrates `enginesCreatedCount` from an ivar to property syntax.

I'll look at migrating engine from `NSMutableArray<NSValue*>` to a weak pointer array in a followup patch since it's orthogonal to ARC migration.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-30 17:56:52 +00:00
Chris Bracken
6a4e814a68 iOS: Migrate FlutterHeadlessDartRunner to ARC (flutter/engine#55502)
This is a subclass of FlutterEngine, which is still manually reference counted, but that's not problematic since the headers have been migrated to ARC-safe syntax that preserves existing behaviour.

No test changes since this patch makes no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-30 16:47:07 +00:00
Chris Bracken
faa6496380 iOS: Migrate FlutterAppDelegate to ARC (flutter/engine#55472)
Migrates the FlutterAppDelegate.mm translation unit to be compiled with the `-fobjc-arc` compiler flag.

No test changes since no this change includes no semantic changes, and thus covered by existing tests such as [`testReleasesWindowOnDealloc`](f6e580d09a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm (L139-L153)).

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-27 22:44:53 +00:00
auto-submit[bot]
fdbad460a5 Reverts "[Impeller] hash even less stuff per frame. (#55092)" (flutter/engine#55491)
Reverts: flutter/engine#55092
Initiated by: jonahwilliams
Reason for reverting: framework golden failures.
Original PR Author: jonahwilliams

Reviewed By: {chinmaygarde, jtmcdole}

This change reverts the following previous change:
Follow up to https://github.com/flutter/engine/pull/55060

Currently we have multiple stages of hashing while font rendering, which is relatively expensive for the actualy required workload. First, we hash the contents of all text frames to compute the unique set of glyphs per frame. Then we diff this hash set against the hashmap of glyphs within the atlas. Finally we hash and lookup the final rendered bounds for each glyph.

We can simplify this to 2. hash lookups for glyphs not yet in the atlas and 1. hash lookup for glyphs that are in the atlas. This is done by combing the step where we uniquely compute glyphs per frame with the diff against the current atlas. When this lookup is performed, we also store the glyph position (if found) in the text_frame itself - which allows text contents to skip the last hash, as long as the glyph has already been rendered.

### Before

![flutter_03](https://github.com/user-attachments/assets/be9c4459-f0c8-426c-b152-38861acb207f)

### After

![flutter_04](https://github.com/user-attachments/assets/1aa7cbd1-6af7-4020-8966-7e3baaef102b)

Using this handy dandy test app:

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  Widget build(context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Platform View'),
        ),
        body: SafeArea(child: Stack(children: [
          SizedBox(
            width: 380,
            height: 380,
            child: LinearProgressIndicator(),
          ),
          Stack(
            children: List<Widget>.generate(1000, (index) {
              // The problem already happens with a small amount of widgets.
              // Using an excessive amount of widgets is just to make the problem more evident.
              return Text("Lots of Texts represent a Widget with complex components.");
            }),
          ),

          Align(
            alignment: Alignment.bottomCenter,
            child:
            TextButton(
              child: Text("Button"),
              onPressed: () {
                print("Tap ${DateTime.now()}");
              },
            ),
          ),
        ],
        ),
        ),
      ),
    );
  }
}
```
2024-09-27 17:09:28 +00:00
Jonah Williams
e9a089f2fe [Impeller] hash even less stuff per frame. (flutter/engine#55092)
Follow up to https://github.com/flutter/engine/pull/55060

Currently we have multiple stages of hashing while font rendering, which is relatively expensive for the actualy required workload. First, we hash the contents of all text frames to compute the unique set of glyphs per frame. Then we diff this hash set against the hashmap of glyphs within the atlas. Finally we hash and lookup the final rendered bounds for each glyph.

We can simplify this to 2. hash lookups for glyphs not yet in the atlas and 1. hash lookup for glyphs that are in the atlas. This is done by combing the step where we uniquely compute glyphs per frame with the diff against the current atlas. When this lookup is performed, we also store the glyph position (if found) in the text_frame itself - which allows text contents to skip the last hash, as long as the glyph has already been rendered.

### Before

![flutter_03](https://github.com/user-attachments/assets/be9c4459-f0c8-426c-b152-38861acb207f)

### After

![flutter_04](https://github.com/user-attachments/assets/1aa7cbd1-6af7-4020-8966-7e3baaef102b)

Using this handy dandy test app:

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  Widget build(context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Platform View'),
        ),
        body: SafeArea(child: Stack(children: [
          SizedBox(
            width: 380,
            height: 380,
            child: LinearProgressIndicator(),
          ),
          Stack(
            children: List<Widget>.generate(1000, (index) {
              // The problem already happens with a small amount of widgets.
              // Using an excessive amount of widgets is just to make the problem more evident.
              return Text("Lots of Texts represent a Widget with complex components.");
            }),
          ),

          Align(
            alignment: Alignment.bottomCenter,
            child:
            TextButton(
              child: Text("Button"),
              onPressed: () {
                print("Tap ${DateTime.now()}");
              },
            ),
          ),
        ],
        ),
        ),
      ),
    );
  }
}
```
2024-09-27 15:34:07 +00:00
Valentin Hăloiu
18b9cd0233 Add format field to EGL surface backing store (flutter/engine#54499)
Trying to use the `GL_BGRA8_EXT` format for the EGL surface backing store on *desktop* OpenGL platforms would fail at: 82d8bc5844/shell/platform/embedder/embedder.cc (L869)

This seems to be a known issue and both the Linux and Windows embedders have some logic to pick a different format depending on the OpenGL context information:

bc8c82d157/shell/platform/windows/compositor_opengl.cc (L23-L34)

bc8c82d157/shell/platform/linux/fl_framebuffer.cc (L81-L104)

This pull-request gets rid of the hard-coded `GL_BGRA8_EXT` format and makes it configurable by adding a `format` field to the `FlutterOpenGLSurface` struct.

_Disclaimer_: This has only been tested on desktop Linux (Wayland) using the `GR_GL_RGBA8` format which seemed to work as expected.

This change is related to the recently introduced EGL surface backing store: https://github.com/flutter/flutter/issues/58363

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-27 00:23:13 +00:00
Jonah Williams
b9d92a4d0c [Impeller] remove entity pass and re-combine canvas implementations. (flutter/engine#55019)
Shouldn't land until experimental canvas bakes a while

Major milestone along the route to making display list the impeller API. Removes the secondary compositor in entity pass. After this point, we can begin ripping out the DL->Aiks conversions and making entities more efficient.

Fixes https://github.com/flutter/flutter/issues/132417
Fixes https://github.com/flutter/flutter/issues/126386
Fixes https://github.com/flutter/flutter/issues/155114

Part of https://github.com/flutter/flutter/issues/142054
2024-09-26 21:20:23 +00:00
auto-submit[bot]
248b86a64b Reverts "Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (#55450)" (flutter/engine#55463)
Reverts: flutter/engine#55450
Initiated by: matanlurey
Reason for reverting: Fixed forward in https://github.com/flutter/packages/pull/7712.
Original PR Author: auto-submit[bot]

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.

Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.

/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
2024-09-26 17:34:17 +00:00
Jonah Williams
33f2dcb7eb [iOS] remove clear color hack. (flutter/engine#54451)
Fixes https://github.com/flutter/flutter/issues/125640

This doesn't actually do anything, instead it forces opaque to false. If developers want opaque to be false, they can just set it directly.
2024-09-26 04:54:11 +00:00
auto-submit[bot]
80ce9f8631 Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (flutter/engine#55450)
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.

Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.

/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
2024-09-26 00:45:46 +00:00
Matan Lurey
e89480f02d Move lint suppression from baseline.xml to @SuppressLint. (flutter/engine#55447)
I think you just had the lint identifier wrong?

Closes https://github.com/flutter/flutter/issues/155712.
2024-09-25 22:41:11 +00:00