29300 Commits

Author SHA1 Message Date
Michael Ludwig
c0e6c19e09 Remove SK_USE_LEGACY_BLUR_RASTER staging flag (flutter/engine#56618)
Also updates the image_filter_test.dart expected color values for a blur unit test. The legacy blur algorithm would a) treat very small blur sigmas as the identity even though the effect was still perceptible and b) was very inaccurate for sigmas < 2.  The unit test used a sigma of 1.0 so fell within the inaccurate range but the expected values appear to have been taken directly from the original Skia output.  This updates them to match the output of the new algorithm (which is also more consistent between CPU and GPU).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-19 02:28:26 +00:00
Jonah Williams
9029dc6bc9 [Impeller] use sync fence for image uploads. (flutter/engine#56609)
Fixes https://github.com/flutter/flutter/issues/158963

If the GLES version is at least 3, then we can attach a sync fence to the texture gles object. If this operation succeeds, then we can use gl.Flush instad of gl.Finish. Then, when binding the texture - if a sync fence is present we wait and then remove the fence.
2024-11-19 00:12:54 +00:00
Reid Baker
ce204dc926 Update emulator definitions version to latest available from chrome infra (flutter/engine#56313)
Update to the latest definitions of emulator configurations.  (except x86/api28 see b/379736755)
Specifically to past  https://crrev.com/c/5908894 which added `gpu_mode: "swangle_indirect"` to the api 35 proto. This should help with emulator stability on versions past android 13. 
Related to  b/371020223
Research notes / my findings for how this system works at go/flutter-android-ci-emulator
2024-11-18 23:23:27 +00:00
skia-flutter-autoroll
4b79a1146d Roll Dart SDK from 625e0a9cb67a to 05d58364e92f (1 revision) (flutter/engine#56688)
https://dart.googlesource.com/sdk.git/+log/625e0a9cb67a..05d58364e92f

2024-11-18 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-160.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 22:31:49 +00:00
Chris Bracken
1671d8c112 iOS: Eliminate unguarded-availability opt-out (flutter/engine#56689)
Eliminates the opt-out of `-Wunguarded-availability-new` in the `ios_test_flutter` target.

Xcode 15 beta XCTest framework headers contained unguarded usage of iOS 17 API. This bug resulted in engine build failures.

This was fixed in a later XCTest framework release.

```
/Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:30: error: 'XCUIAccessibilityAuditType' is only available on iOS 17.0 or newer [-Werror,-Wunguarded-availability-new]
   19 | typedef NS_OPTIONS(uint64_t, XCUIAccessibilityAuditType) {
      |                              ^
/Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:30: note: 'XCUIAccessibilityAuditType' has been marked as being introduced in iOS 17.0 here, but the deployment target is iOS 13.0.0
/Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:9: note: annotate anonymous enum with an availability attribute to silence this warning
   19 | typedef NS_OPTIONS(uint64_t, XCUIAccessibilityAuditType) {
      |         ^
/Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:383:34: note: expanded from macro 'NS_OPTIONS'
  383 | #define NS_OPTIONS(_type, _name) CF_OPTIONS(_type, _name)
      |                                  ^
/Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:155:96: note: expanded from macro 'CF_OPTIONS'
  155 | #define CF_OPTIONS(_type, _name) __attribute__((availability(swift,unavailable))) _type _name; enum __CF_OPTIONS_ATTRIBUTES : _name
      |
```

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 22:26:10 +00:00
Jackson Gardner
d9dce77156 [skwasm] Use displayWidth/displayHeight instead of codedWidth/codedHeight (flutter/engine#56686)
This addresses https://github.com/flutter/flutter/issues/159088

If the image is rotated in its exif data, the coded width/height may differ from the display width/height. It's important to use the display width/height so that `texImage2D` does the right thing with the `VideoFrame`.
2024-11-18 22:05:58 +00:00
Chris Bracken
6226520c45 Extract TestGLContext to separate translation unit (flutter/engine#56647)
For consistency with the Test.*Context classes for other backends, which live in their own implementation file with their own header, extract TestEGLContext to its own header and TU so that in cases where only a TestEGLContext is required (e.g. EmbedderTestBackingStoreProducerGL), we don't need to include all the various test GL surface classes as well.

GetEGLError is used by both TestEGLContext and the TestGLSurface classes, so moves to its own utils file.

No tests because this is a refactoring with no semantic changes, and the code itself is test code.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 21:56:05 +00:00
skia-flutter-autoroll
15007b963a Roll Skia from b79e71223284 to 492e8347d7a4 (2 revisions) (flutter/engine#56687)
https://skia.googlesource.com/skia.git/+log/b79e71223284..492e8347d7a4

2024-11-18 maxhudnell@google.com add triangulated gradient effect
2024-11-18 vigneshv@google.com SkCrabbyAvifCodec: Add RGB565 support

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,michaelludwig@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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 21:53:56 +00:00
Jason Simmons
b00882774a Update the Skia build scripts for a refactoring of the Fontconfig font manager (flutter/engine#56684)
Skia is reorganizing some font managers, and the Flutter engine's build scripts need to match the changes made to Skia.

See https://skia-review.googlesource.com/c/skia/+/915316
2024-11-18 21:38:59 +00:00
Chris Bracken
bcbcb6631e iOS,macOS: Enable ARC in flutter_cflags_objc[c] (flutter/engine#56685)
Enables the `-fobjc-arc` compiler flag for Objective-C and Objective-C++
translation units.

Eliminates the flutter_cflags_objc[c]_arc settings, since they're now
redundant.

All Obj-C/Obj-C++ code in our codebase has now been migrated to ARC.

Issue: https://github.com/flutter/flutter/issues/137801
2024-11-18 13:37:40 -08:00
Matan Lurey
d2d49cabe7 Re-land "Remove android_jit_release_x86." (flutter/engine#56681)
Reverts flutter/engine#56634 (https://github.com/flutter/flutter/pull/159011 has merged).
2024-11-18 21:00:06 +00:00
skia-flutter-autoroll
6d156b221e Roll Skia from 0d24bd3268ef to b79e71223284 (1 revision) (flutter/engine#56683)
https://skia.googlesource.com/skia.git/+log/0d24bd3268ef..b79e71223284

2024-11-18 vigneshv@google.com SkCrabbyAvifCodec: Compute fGainmapMathColorSpace

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,michaelludwig@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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 20:34:22 +00:00
Juanjo Tugores
04f26f4377 Flutter views can gain focus (flutter/engine#54985)
I am unsure why the `tabindex` was removed when semantics were enabled. It seems this change was made without a clear explanation (by me). This PR shouldn't cause any issues as Flutter Views already have a tabindex, we're not adding a new one. This change is necessary because the semantics text strategy refocuses the view on deactivation, requiring the Flutter view to be focusable.

ThIs PR is a requirement to enable https://github.com/flutter/engine/pull/54966. 

https://github.com/flutter/flutter/issues/153022

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 20:26:13 +00:00
Chris Bracken
6760858896 EmbedderTest: Extract backend-specific user_data (flutter/engine#56642)
Replace the top-level public EmbedderBackingStoreProducer::UserData struct with backend-specific UserData classes, and make them internal to those backends. UserData internals shouldn't be visible to/manipulated by unit tests and compositors, but instead constrained to the backing store producer itself.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 18:38:27 +00:00
skia-flutter-autoroll
2840d4941f Roll Dart SDK from ae5111067032 to 625e0a9cb67a (1 revision) (flutter/engine#56679)
https://dart.googlesource.com/sdk.git/+log/ae5111067032..625e0a9cb67a

2024-11-18 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-159.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 18:18:19 +00:00
gaaclarke
daa1bbbed7 Started only loading gles3 functions if we have a gles3 context (flutter/engine#56636)
test: exists in https://github.com/flutter/engine/pull/56596
fixes: https://github.com/flutter/flutter/issues/158995

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 18:08:02 +00:00
gaaclarke
9f1adb8ff4 [impeller] enable framebuffer blit when available (flutter/engine#56596)
depends on https://github.com/flutter/engine/pull/56573
fixes https://github.com/flutter/flutter/issues/158523

## 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-11-18 09:54:06 -08:00
skia-flutter-autoroll
e60c112ad0 Roll Skia from 7594233ff914 to 0b74d5c3eb4f (4 revisions) (flutter/engine#56678)
https://skia.googlesource.com/skia.git/+log/7594233ff914..0b74d5c3eb4f

2024-11-18 borenet@google.com [infra] Remove P400 jobs from CQ
2024-11-18 robertphillips@google.com [graphite] Add PrecompileContext object
2024-11-18 paulsemel@chromium.org Add buganizer ID to DIR_METADATA
2024-11-18 michaelludwig@google.com [viewer] QOL improvements to perspective and zoom

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,michaelludwig@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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 16:58:15 +00:00
skia-flutter-autoroll
1cd9489598 Roll Dart SDK from 8795a3eaa87b to ae5111067032 (1 revision) (flutter/engine#56675)
https://dart.googlesource.com/sdk.git/+log/8795a3eaa87b..ae5111067032

2024-11-18 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-158.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 14:10:24 +00:00
Kaylee Lubick
65ac39d742 Use updated gni source list (flutter/engine#56627)
In https://skia-review.googlesource.com/c/skia/+/884096, Skia broke up
this gni file list into Ganesh and Graphite specific code. Since Flutter
only needs Ganesh sources, this can be made more precise.

## 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].
- [ ] 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-11-18 07:55:55 -05:00
skia-flutter-autoroll
b6078f3688 Roll Fuchsia Linux SDK from K-3yXpPmmu1f0idCa... to io00npG_eDCYC7bac... (flutter/engine#56673)
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,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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 11:39:23 +00:00
skia-flutter-autoroll
43d1faf0dc Roll Skia from 452208ce96aa to 5968000526fe (3 revisions) (flutter/engine#56671)
https://skia.googlesource.com/skia.git/+log/452208ce96aa..5968000526fe

2024-11-18 skia-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from 33dc1606ee3b to 15492c9bc44d (1 revision)
2024-11-18 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Dawn from 43b18d23f1be to 3fc6432bcc2f (1 revision)
2024-11-18 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Skia Infra from 8b12c3aa2ef9 to 523dc313e7a2 (9 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,jimgraham@google.com,michaelludwig@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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-18 09:14:27 +00:00
Chris Bracken
ab0a04d3a7 iOS: Clean up @synthesize directives / ivars (flutter/engine#56665)
In modern Objective-C, `@property` directives automatically generate a backing ivar (property name prefixed with an underscore), the getter, and (for readwrite properties) the setter. `@synthesize` directives are generally only required if the backing ivar has a different name from the property.

Also updates the FlutterMetalLayer API to match CAMetalLayer:
* Adds API_AVAILABLE declaration to match that on CAMetalLayer.
* Eliminates wantsExtendedDynamicRangeContent property as it's also part of CALayer's interface and unused in our implementation.

Also eliminates unnecessary ivars where they're being synthesized by `@property` declarations.

Previously, we were overriding the behaviour of
UIViewController.prefersStatusBarHidden by synthesizing _flutterPrefersStatusBarHidden as a backing ivar. Since we're explicitly overriding the behaviour of a superclass, it's more idiomatic to synthesize a private property or explicitly declare an ivar then explicitly override the getter instead.

Further, this adds documentation to cases where `@synthesize` directives are required, such as:
* Creating a backing ivar for a readonly property.
* Creating a backing ivar for a property with a custom getter/setter.
* Synthesising the ivar, getter, and setter for a property declared in a protocol being implemented.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 00:29:24 +00:00
Chris Bracken
d82d8cf3cd iOS: Extract constant for CADisableMinimumFrameDurationOnPhone (flutter/engine#56659)
In our vsync waiter and related tests, we hardcode the "CADisableMinimumFrameDurationOnPhone" key in several places. This pulls those into a constant kCADisableMinimumFrameDurationOnPhoneKey declared in the vsync waiter header, which is non-public, and uses that instead.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-17 23:21:10 +00:00
Chris Bracken
c9f8ebef70 iOS: Eliminate unnecessary use of NSClassFromString (flutter/engine#56660)
When performing `isKindOfClass` checks, we were occasionally looking up the class in question using `NSClassFromString()`, instead we now check against the class directly, which has the added benefit of being type-safe, and not succeptible to string typos.

Moves the declaration of ForwardingGestureRecognizer and FlutterDelayingGestureRecognizer to the FlutterPlatfomViews_Internal.h header, which is non-public.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-17 22:53:05 +00:00
Chris Bracken
33b5f9dc00 iOS: Eliminate unnecessary bridged retain casts (flutter/engine#56662)
This replaces a few ARC bridged retain casts to regular bridge casts to CoreFoundation types, which are then CFRetained via `sk_cfp::retain` calls.

This eliminates the last remaining unnecessary __bridge_retained casts in the codebase. The remaining casts have been manually vetted and are reasonable.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-17 22:41:43 +00:00
Chris Bracken
89ce6055a6 iOS,macOS: Fix string constant declarations (flutter/engine#56661)
A couple string constants had been incorrectly declared `const NSString*` rather than `NSString* const`. The former is a pointer to an immutable string, but (a) the pointer can be reassigned and (b) the default NSString implementation is immutable. The latter is an immutable pointer to a string, which is what we want, since we don't want developers reassinging our constants to other values.

Also updates an identifier name to pass lint rules.

No changes to tests since this is "tested" by the compiler.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-17 22:41:41 +00:00
Chris Bracken
13c156630a iOS: Make FlutterViewController.engine a strong ref (flutter/engine#56663)
Previously, FlutterViewController.engine was declared as a weak readonly property, but we explicitly declared the `FlutterEngine* _engine` ivar as a strong reference in the implementation. This changes the property declaration to be strong and eliminates the now unnecessary ivar.

There is also no semantic change to FlutterViewController itself, since the `_engine` ivar had been manually declared as a strong reference.

There is no semantic change for users of FlutterViewController.engine since whether a user acquires a strong or weak reference to the engine is determined by whether they declare the pointer to which they assign it as strong or weak.

This also eliminates the need for the `engine` getter, which was only present to prevent a warning that the strong ivar didn't match the weak property declaration.

No changes to tests since this introduces 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-11-17 22:41:39 +00:00
Chris Bracken
20e0482db7 iOS: Clean up uses of string literal constants (flutter/engine#56658)
Three changes related to string constants:

1. Uses the kIOSurfaceColorSpace constant, which is a CFStringRef pointing to the string "IOSurfaceColorSpace"

2. Uses the kCVPixelFormatType_32BGRA enum value from the CoreVideo headers (which is equal to 'BGRA') in place of hardcoding the string.

From the headers:
```
kCVPixelFormatType_32BGRA         = 'BGRA',     /* 32 bit BGRA */
```

3. Declares kIOServicePlane as a `constexpr const char*` rather than `static const char*`, this ensures only a single instance is created, rather than one per translation unit into which the header is included. This string is part of IOKit, but see the comment at the top of the header as to why it's apparently needed.

No test changes since there are no semantic changes.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-17 22:30:19 +00:00
skia-flutter-autoroll
f8d5265568 Roll Fuchsia Linux SDK from c5padahsa9sMecBb3... to K-3yXpPmmu1f0idCa... (flutter/engine#56656)
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,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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-17 09:52:24 +00:00
Chris Bracken
9a2c95dc83 iOS: Eliminate FlutterEngine dealloc notification (flutter/engine#56650)
FlutterEngineGroup keeps an array of all live FlutterEngine instances it has created such that after the first engine, it can spawn further engines using the first.

Previously we manually managed this array by adding engines to it upon creation, then having [FlutterEngine dealloc] emit a notification such that FlutterEngineGroup can listen for it, and remove instances from the array upon reception of the notification.

Instead, we now use an NSPointerArray of of weak pointers such that pointers are automatically nilled out by ARC after the last strong reference is collected. This eliminates the need for the manual notification during dealloc.

Unfortunately, NSPointerArray is "clever" and assumes that if the array has not been mutated to store a nil pointer since its last compact call, it must not contain a nil pointer and can thus skip compaction. Under ARC, weak pointers are automatically nilled out when the last strong reference is released, so the above heuristic is no longer valid. We work around the issue by storing a nil pointer before calling compact.

See http://www.openradar.me/15396578 for the radar tracking this bug.

I'm not thrilled with the fact that we're replacing one sort of TODO with another, but the code is much simpler and avoids relying on a trip through the notification center, which seems objectively better.

Issue: https://github.com/flutter/flutter/issues/155943
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-11-17 03:50:19 +00:00
skia-flutter-autoroll
74650a44ff Roll Dart SDK from dfa7b3ac976b to 8795a3eaa87b (1 revision) (flutter/engine#56652)
https://dart.googlesource.com/sdk.git/+log/dfa7b3ac976b..8795a3eaa87b

2024-11-16 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-157.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-17 01:04:13 +00:00
skia-flutter-autoroll
3b30862c42 Roll Dart SDK from d47c22e5f63a to dfa7b3ac976b (1 revision) (flutter/engine#56649)
https://dart.googlesource.com/sdk.git/+log/d47c22e5f63a..dfa7b3ac976b

2024-11-16 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-156.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-16 20:53:33 +00:00
hellohuanlin
aae55894be [ios]fix unused variable clang tidy warning (flutter/engine#56637)
Spot another clang-tidy linter failure from: https://github.com/flutter/engine/pull/56631

In release mode, if we remove NSAssert, then weakFlutterEngine is not used at all. This should have been an XCTAssert rather than NSAssert in the first place. 

```
❌ Failures for clang-tidy on /Volumes/Work/s/w/ir/cache/builder/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm:
/Volumes/Work/s/w/ir/cache/builder/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm:239:5: error: Value stored to 'weakFlutterEngine' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  239 |     weakFlutterEngine = flutterEngine;
      |     ^                   ~~~~~~~~~~~~~
/Volumes/Work/s/w/ir/cache/builder/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm:239:5: note: Value stored to 'weakFlutterEngine' is never read
  239 |     weakFlutterEngine = flutterEngine;
      |     ^                   ~~~~~~~~~~~~~
Suppressed 9240 warnings (9111 in non-user code, 129 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
```

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

*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-11-16 17:26:20 +00:00
skia-flutter-autoroll
b7dfbf52ca Roll Fuchsia Linux SDK from UpSQzyXGUhMfedYIh... to c5padahsa9sMecBb3... (flutter/engine#56645)
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,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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-16 08:28:23 +00:00
skia-flutter-autoroll
75ab0b856b Roll Dart SDK from 77a4ee3266a4 to d47c22e5f63a (1 revision) (flutter/engine#56644)
https://dart.googlesource.com/sdk.git/+log/77a4ee3266a4..d47c22e5f63a

2024-11-16 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-155.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-16 07:06:23 +00:00
Chris Bracken
2a4bfedb9a Backend-specific EmbedderTestBackingStoreProducers (flutter/engine#56638)
Extracts backend-specific subclasses of EmbedderTestBackingStoreProducer for OpenGL, Metal, Software, and Vulkan.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-16 02:48:31 +00:00
skia-flutter-autoroll
f67d258c32 Roll Dart SDK from eccb15756020 to 77a4ee3266a4 (1 revision) (flutter/engine#56640)
https://dart.googlesource.com/sdk.git/+log/eccb15756020..77a4ee3266a4

2024-11-16 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-154.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-16 02:36:34 +00:00
skia-flutter-autoroll
f71656d7ab Roll Skia from 1ef3b910e064 to 6b0f264bde33 (6 revisions) (flutter/engine#56635)
https://skia.googlesource.com/skia.git/+log/1ef3b910e064..6b0f264bde33

2024-11-15 lukasza@chromium.org [rust png] Add new API: `SkColorSpace::MakeCICP`.
2024-11-15 jvanverth@google.com Subset SkImage_Picture objects instead of rendering to Bitmap image.
2024-11-15 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 8ec693ec8ed6 to 834044be8e1f (3 revisions)
2024-11-15 kjlubick@google.com Remove duplicated reference to SkSLSampleUsage
2024-11-15 kjlubick@google.com Remove duplicate copy of codegen headers in .gni files
2024-11-15 borenet@google.com [infra] Support running Android tests on hosts other than RPI

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 brettos@google.com,brianosman@google.com,jimgraham@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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-16 00:22:08 +00:00
Zachary Anderson
abb5c0696f Revert "Remove android_jit_release_x86." (flutter/engine#56634)
Reverts flutter/engine#56548

Failing roll to the framework, the tool is still looking for these
artifacts.
2024-11-15 16:14:47 -08:00
Chris Bracken
2b420dcf9c Move SetRenderTargetType to EmbedderTestCompositor (flutter/engine#56626)
SetRenderTargetType is used to configure the backingstore producer on the compositor, but the backingstore types available to any given compositor are limited to the specific graphics backend in use: Software, GL, Metal, or Vulkan.

This moves SetRenderTargetType to EmbedderTestCompositor and its subclasses and adds RenderTargetType validation. A follow-up patch will refactor EmbedderTestBackingStoreProducer into backend-specific subclasses.

For OpenGL backingstore producers, the egl_context_ from EmbedderTestContext (which is actually set in the EmbedderTestContextGL subclass and should live there, but that's a separate cleanup) is required in SetRenderTargetType, so we now inject it into EmbedderTestCompositor in the constructor so it's available when needed.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-15 23:28:49 +00:00
skia-flutter-autoroll
8b67ea6d10 Roll Dart SDK from b62dadb14d82 to eccb15756020 (2 revisions) (flutter/engine#56630)
https://dart.googlesource.com/sdk.git/+log/b62dadb14d82..eccb15756020

2024-11-15 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-153.0.dev
2024-11-15 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.7.0-152.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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-11-15 22:17:20 +00:00
André Stein
5ae19147fa [TextInput] Add TextInputType.webSearch (#15762) (flutter/engine#56428)
This PR adds the engine part to add `TextInputType.webSearch` that allows to show a keyboard with ready access to a "." key on iOS. On Android this is re-mapped to `url` which shows the same behaviour as `webSearch` on iOS. This fixes issue https://github.com/flutter/flutter/issues/157562.

The flutter PR: https://github.com/flutter/flutter/pull/158323
2024-11-15 21:51:21 +00:00
Mouad Debbar
d27125f326 [web] Send the correct view ID with semantics actions (flutter/engine#56595)
Currently, all semantics actions that we send to the framework contain `viewId: 0`. This leads to issues such as https://github.com/flutter/flutter/issues/158530 because the framework routes the pointer event to the wrong view.

Let's send the correct view ID with semantics actions.

Fixes https://github.com/flutter/flutter/issues/158530
2024-11-15 20:28:59 +00:00
hellohuanlin
453afd650f [macos] early return to suppress clang-tidy warning (flutter/engine#56588)
If we disable the NSAssert during release mode, this code will continue after NSAssert failure, which will then pass a `nil` value into a dictionary (which cannot have a nil value), hence the clang-tidy warning here https://github.com/flutter/engine/pull/53005#issuecomment-2140975126

*List which issues are fixed by this PR. You must list at least one issue.*
https://github.com/flutter/flutter/issues/148279
https://github.com/flutter/flutter/issues/157837

*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-11-15 20:25:17 +00:00
Chinmay Garde
08b52b491b [Impeller] libImpeller: Tinker on the README to cross reference the SDK and the example. (flutter/engine#56623) 2024-11-15 20:21:17 +00:00
巢鹏
2faf5c1ff6 [fuchsia] MaybeRunInitialVsyncCallback should only called once (flutter/engine#56429)
Currently, flutter keeps calling MaybeRunInitialVsyncCallback() until 1
OnNextFrameBegin() called from Fuchsia which maybe problem when display
is off.

Tested manually.

Bug: http://fxbug.dev/376079469

## 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.
2024-11-15 14:05:06 -05:00
Jenn Magder
8e0d6da738 Move mac clangd build from x64 to arm (flutter/engine#56567)
Build and x64 dimension was introduced in https://github.com/flutter/engine/pull/50901, and I blindly copied it into the .ci.yaml in https://github.com/flutter/engine/pull/56014.  However I don't think clangd needs to run on the scarce (and flakier) Intel Macs (37 x64 bots in prod vs 55 arm bots).  Suspect this was copied from clang_tidy #26910

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-15 18:46:34 +00:00
gaaclarke
11123f1bbf Added assert for opengles thread safety (flutter/engine#56585)
This assert would have blocked the following bug:
https://github.com/flutter/flutter/issues/158535

This shouldn't be landed until
https://github.com/flutter/engine/pull/56573 lands.

## 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.
- [ ] 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-11-15 10:22:46 -08:00
Jonah Williams
d0cf81dfe0 [Impeller] enable OpenGL fallback on Android. (flutter/engine#56591)
Ship impeller OpenGLES on non-vulkan android devices

Fixes https://github.com/flutter/flutter/issues/158361
2024-11-15 16:48:05 +00:00