5735 Commits

Author SHA1 Message Date
Jason Simmons
3708a26cba Migrate the Fuchsia embedder to the Dart_RecordTimelineEvent API (flutter/engine#50823)
Dart_TimelineEvent has been deprecated.
2024-02-21 18:26:55 +00:00
John McCutchan
304382c276 Hook ImageReaderSurfaceProducer to the onTrimMemory listener interface (flutter/engine#50792)
- Close all ImageReaders and Images when we get an onTrimMemory
callback.
- Remove the first frame fix based around caching the last image
displayed because it isn't safe to do on some platforms. Leave a TODO to
revisit this.

We have seen some reports of platform views not working after an
application is backgrounded and then resumed. According to Android GPU
folks ImageReader/Image/HardwareBuffers should be valid after an
application has been resumed. However on Samsung we know that isn't the
case and there are (unconfirmed) reports of it also impacting Pixel
devices.

Should fix https://github.com/flutter/flutter/issues/142978 and
https://github.com/flutter/flutter/issues/139039

Also fixes https://github.com/flutter/flutter/issues/143720
2024-02-21 10:02:55 -08:00
Zachary Anderson
f6629ffe5c Use 'et format' in CI. Check formatting of all files in CI (flutter/engine#50810)
This PR changes the format check on CI to use the command added in
https://github.com/flutter/engine/pull/50747.

Additionally, while making this change, I noticed that the CI check was
not checking the formatting of all files, and that as a result, files
were present in the repo with incorrect formatting. I have fixed the
formatting and fixed the check to always check all files.
2024-02-21 09:38:08 -08:00
Loïc Sharma
7c8dcec741 [Windows] Add ID to views (flutter/engine#50788)
Adds an ID to a view:

1. `FlutterWindowsView` now has a ID
2. The `FlutterWindowsEngine::view(...)` accessor now requires a view ID parameter

This is a refactoring with no semantic changes.

Part of https://github.com/flutter/flutter/issues/143765

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-20 20:40:04 +00:00
Jason Simmons
c0159abf1b Implement the render_to_surface flag in GPUSurfaceGLImpeller (flutter/engine#50669)
Without this, the EmbedderExternalViewEmbedder's call to SurfaceFrame::Submit will render an empty display list that will overwrite the output rendered by the external view embedder's layers.

See https://github.com/flutter/flutter/issues/143387
2024-02-20 19:27:09 +00:00
Loïc Sharma
f3ad50c810 [Windows] Make the engine create the view (flutter/engine#50673)
This makes the Windows engine create views. Benefits:

1. This will allow the engine to assign IDs to views as it creates them. This will be added in a subsequent change
2. Previously views needed special logic to not crash if they were used before an engine was attached to them. Now, views are always attached to an engine.

Part of https://github.com/flutter/flutter/issues/137267
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-20 16:41:46 +00:00
Taha Tesser
393748e8c5 Revert "Fix iOS password autofill prompt dismissal causes layout to resize (#50364)" (flutter/engine#50760)
This reverts commit 5f93393312241b5616a9253b7bf9cd82b5d77dda.

Reverts https://github.com/flutter/engine/pull/50364

fixes https://github.com/flutter/flutter/issues/143642

*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].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-19 09:36:32 +00:00
Robert Ancell
0c1e0846c0 Connect signals in swapped form. (flutter/engine#50705)
This makes them look more like methods.
2024-02-16 17:01:03 -08:00
Loïc Sharma
89b44f4fff [Windows] Improve FlutterWindow unit tests (flutter/engine#50676)
_This was split from https://github.com/flutter/engine/pull/50673 to reduce noise in that PR._

Previously `MockFlutterWindow` called a `FlutterWindow` constructor which created a window & resized it. This change introduces a minimal base constructor for testing purposes. This allows us to skip some noisy mocks in a subsequent change: https://github.com/flutter/engine/pull/50673

This also introduces a fixture for the window unit tests.

Part of https://github.com/flutter/flutter/issues/137267
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-16 00:38:18 +00:00
Rulong Chen(陈汝龙)
8d744a5fbe [Android] Remove the unnecessary parent interface. (flutter/engine#50677)
`ImageConsumer` and `GLTextureConsumer` should not inherit from `TextureEntry`.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-15 21:49:54 +00:00
Jonah Williams
dac5a4b792 [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
See also https://github.com/flutter/flutter/issues/140901 . We were not accounting for GPU backpressure in the FML, this applies the patch from @knopp to track this.
2024-02-15 16:28:33 +00:00
Chinmay Garde
6c17d7bf9d Use a GN variable (dart_src) to reference the location of the Dart checkout. (flutter/engine#50624)
Towards https://github.com/flutter/flutter/issues/143335
2024-02-14 21:12:23 -08:00
Rulong Chen(陈汝龙)
07c39717a4 [Android] Minor refactor: Remove redundant methods. (flutter/engine#50647)
This is a minor refactoring with no semantic changes.

## 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.
- [ ] 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 `///`).
- [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-14 17:11:54 -08:00
Gray Mackall
4667868149 Fix github md "Note" and "Tip" blocks in Android shell README (flutter/engine#50664)
Fixes a couple of misformatted "NOTE" and "TIP" blocks.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-14 23:21:16 +00:00
Chris Bracken
932ecf69e0 macOS: add stubs for PlatformView gesture handling (flutter/engine#50630)
Adds method handler stubs for acceptGesture and rejectGesture channel method invocations. This avoids error messages being logged and puts in place the scaffolding for the implementation.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-14 19:47:57 +00:00
Gray Mackall
42bdee9589 Make Android Studio depend on the android_embedding_dependencies (flutter/engine#50612)
Aligns our (Android Studio) IDE support with the actual dependencies that get resolved by our build process, by depending on the androidx jars directly.

Follow up to [discord discussion](https://discord.com/channels/608014603317936148/1204566292346961950/1204594136343248946).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-14 01:12:07 +00:00
Loïc Sharma
729dd91430 [Windows] Refactor window destroyed app lifecycle event (flutter/engine#50565)
Improves Windows's lifecycle event for window destruction:

1. Made `FlutterWindowsView` generate the "window hidden" event when the HWND is destroyed instead of the `FlutterWindow`.
    1. Before the window would submit this event using a destroyed view:
        1. The `FlutterWindowsView` destructor runs to completion.
        2. The view owns the window, so the `FlutterWindow` is destroyed
        3. The window's destructor generates a "window hidden" event
        4. The window uses the destroyed view to notify the engine of the event
2. Adds an app lifecycle integration test to verify the `resumed` and `hidden` events are sent when an app is launched and closed.
3. Removed the `FlutterWindowTest` type as it was unused

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-13 22:35:42 +00:00
Jason Simmons
5b220df694 Update embedder support for Impeller/OpenGL to load some missing shaders and configure a depth attachment (flutter/engine#50416) 2024-02-13 18:55:10 +00:00
Robert Ancell
51c9fc1c08 Replace usage of an integer for GdkModifierType (flutter/engine#50481)
The integer is replaced with the enumerated type in GTK4. The
documentation in GTK3 indicates the value is the enumerated type.
2024-02-13 12:26:46 +13:00
Robert Ancell
08995aae83 Remove FlKeyEvent.dispose_origin and use GdkEvent type for origin (flutter/engine#50483)
This removes casting. origin was a pointer for testing purposes to be
mocked but the tests make no use of this.
2024-02-13 12:19:29 +13:00
Loïc Sharma
9c365da297 [Windows] Make the view own its EGL surface (flutter/engine#50421)
This makes the view own its EGL surface. This will allow us to support multiple EGL surfaces once the engine supports having multiple views.

Some notable changes:

1. EGL surface resizing logic is now entirely in `FlutterWindowsView`. Previously some resizing logic was in the `egl::Manager`, however, the view has to handle resizing failures so this unifies the logic in one place.
2. The `OnEmptyFrameGenerated` and `OnFrameGenerated` now return `false` (aka "don't present") if the surface is invalid. This simplifies the compositor as it no longer needs to check for invalid surfaces
3. This introduces a `ViewModifier` testing helper to allow overriding a view's surface. This isn't strictly necessary, tests can setup a surface by mocking several EGL methods and calling `FlutterWindowsView::CreateRenderSurface()`. However, this is verbose & heavily tied to implementation details. The `ViewModifier` avoids this boilerplate.
4. `CompositorOpenGL`'s initialization now makes the render context current without any render surfaces. Previously it also made the view's surface current, which was unnecessary.

Part of https://github.com/flutter/flutter/issues/137267

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-12 18:22:51 +00:00
Miguel
884512b9e4 [fuchsia] Update Inspect library usage (flutter/engine#50467)
The new Inspect library uses InspectSink as described in
[RFC-168](https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0168_exposing_inspect_through_inspectsink?hl=en).

Additionally it's using the new CPP bindings instead of the deprecated
HLCPP bindings.

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

I've verified on a relevant Fuchsia build that the Flutter runner
continues to correctly publish Inspect after this change.

## 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-02-12 17:42:16 +00:00
Dan Field
2f964dfe37 Refactor NDK helpers some more, add methods for SurfaceControl/Transaction, tests (flutter/engine#50540)
Adds more dynamic method lookups in service of https://github.com/flutter/flutter/issues/143105

Moves the TU out to FML so that Impeller can more easily use it.

Adds checking on `AHardwareBuffer_getId` so that it checks the return value before returning what is potentially garbage.

Adds some smoke tests to make sure these things actually work/look up meaningful symbols. Test is in the shell because we have testing infra for this kind of thing there.
2024-02-12 17:12:06 +00:00
Dan Field
b56621e3ae Clean up additional NDK helper related code (flutter/engine#50518)
Moves more dlsym related code to ndk_helpers.h/cc.
2024-02-10 01:08:08 +00:00
skia-flutter-autoroll
b5f6bc2878 Manual roll Dart SDK from 452dd17120b7 to 03130d49f214 (4 revisions) (flutter/engine#50494)
Manual roll requested by zra@google.com

https://dart.googlesource.com/sdk.git/+log/452dd17120b7..03130d49f214

2024-02-08 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com
Version 3.4.0-120.0.dev
2024-02-08 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com
Version 3.4.0-119.0.dev
2024-02-07 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com
Version 3.4.0-118.0.dev
2024-02-07 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com
Version 3.4.0-117.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 chinmaygarde@google.com,dart-vm-team@google.com,zra@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

---------

Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
2024-02-09 08:57:18 -08:00
Jason Simmons
ab7f3cccc4 [Impeller] Remove the Vulkan queue submit thread and always present Vulkan images on the raster thread (flutter/engine#50484)
The queue submit thread could sometimes call vkQueuePresentKHR while the raster thread is calling vkAcquireNextImageKHR.  The simultaneous use of the swapchain on multiple threads violates Vulkan threading rules.
2024-02-09 15:23:07 +00:00
Chinmay Garde
c095d66749 Sever the //flutter/vulkan dependency in Flutter in the Android embedder. (flutter/engine#50472)
The previous code was setting up a proc table, then getting the address of the proc that was used to the setup that table, then setting up another proc table. Directly setup the final proc table and don't depend on //impeller/vulkan.

Part of https://github.com/flutter/flutter/issues/143127
Similar to https://github.com/flutter/engine/pull/50454
2024-02-09 00:06:13 +00:00
Chinmay Garde
a506103288 Sever the //flutter/vulkan dependency in Flutter tester. (flutter/engine#50454)
The previous code was setting up a proc table, then getting the address of the proc that was used to the setup that table, then setting up another proc table. Directly setup the final proc table and don't depend on //impeller/vulkan.

Part of https://github.com/flutter/flutter/issues/143127
2024-02-08 21:37:38 +00:00
Robert Ancell
6f39b9941b Clear objects before setting them. (flutter/engine#50344)
The existing code worked, but it cleared the objects before calling
init_keyboard. This made it look like init_keyboard might leak the
existing values. If a third case was added later where init_keyboard was
called it would leak if the caller didn't clear the objects before
calling it.
2024-02-08 16:20:57 +13:00
Rulong Chen(陈汝龙)
e3b318920a [ios] Fix memory leak in ChildClippingView (flutter/engine#50389)
This fixes the memory leak in `ChildClippingView`.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-08 01:43:37 +00:00
Michael Goderbauer
c3d355cadd Report display sizes in physical pixels on MacOS (flutter/engine#50221)
Fixes https://github.com/flutter/flutter/issues/142629

`Display.size`'s [documentation](https://main-api.flutter.dev/flutter/dart-ui/Display/size.html) says (emphasize mine):

> The **physical** size of this display.

But we have actually been reporting the size in logical pixels - up until now!
2024-02-07 23:19:19 +00:00
Dan Field
9f9ab34867 [Impeller] Log non-default graphics backend usages, use IMPORTANT rather than ERROR (flutter/engine#50448)
Fixes https://github.com/flutter/flutter/issues/142488

- Only logs on iOS if Skia is used instead of Impeller.
- Logs on other platforms if Impeller is used instead of Skia.
- Uses "IMPORTANT" rather than "ERROR" for these logs. This will show up by default since flutter_tools sets ERROR and above as logs to show.
- Adds some tests.
- Makes INFO log print file paths the same as other verbosities.
2024-02-07 21:29:12 +00:00
zijiehe@
9a5734f5a9 Redo "[Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds" (flutter/engine#50408)
Reverts flutter/engine#50407,
https://github.com/flutter/flutter/issues/142811, redo
https://github.com/flutter/engine/pull/50058.

Comparing to the original change, this redo disabled lto / link time
optimization for x64 release builder. It's a known issue that lto
increased the compilation time from <5 min to over 30 min. (See commit
a1b104c61b.)
Disabling lto is safe on x64 release since fuchsia assembly uses arm64
release build on smart display instead. But I will send a PSA to the
fuchsia team before submitting this change.

Following is the original change description.

This change implements a BundledTestRunner to run most of the tests in
testing/fuchsia/test_suites.yaml as ExecutableTestRunner.

- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.

The BundledTestRunner can share most of the logic in
ExecutableTestRunner and avoid reinventing the wheel.

This change also fixes the build break of fuchsia_tests in
fuchsia_release_x64 which allows tests to run on the build as well.

- Tests not built with AOT are filtered out with variant field in
test_suites.yaml.

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

## 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-07 09:50:23 -08:00
auto-submit[bot]
6173975c27 Reverts "Revert "Revert "[Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds""" (flutter/engine#50407)
Reverts "Reland "[Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds"""

Reverts flutter/engine#50295

Initiated by: zanderso

Reason for reverting: Timing out on CI

Original PR Author: zijiehe-google-com

Reviewed By: {keyonghan}

This change reverts the following previous change:
Original Description:
Reverts flutter/engine#50291, https://github.com/flutter/flutter/issues/142811

Following is the original change description.

This change implements a BundledTestRunner to run most of the tests in testing/fuchsia/test_suites.yaml as ExecutableTestRunner.

- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.

The BundledTestRunner can share most of the logic in ExecutableTestRunner and avoid reinventing the wheel.

This change also fixes the build break of fuchsia_tests in fuchsia_release_x64 which allows tests to run on the build as well.

- Tests not built with AOT are filtered out with variant field in test_suites.yaml.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-06 18:49:25 +00:00
zijiehe@
76dce91cf2 Revert "Revert "[Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds"" (flutter/engine#50295)
Reverts flutter/engine#50291,
https://github.com/flutter/flutter/issues/142811

Following is the original change description.

This change implements a BundledTestRunner to run most of the tests in
testing/fuchsia/test_suites.yaml as ExecutableTestRunner.

- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.

The BundledTestRunner can share most of the logic in
ExecutableTestRunner and avoid reinventing the wheel.

This change also fixes the build break of fuchsia_tests in
fuchsia_release_x64 which allows tests to run on the build as well.

- Tests not built with AOT are filtered out with variant field in
test_suites.yaml.

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

## 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-06 09:34:53 -08:00
Jonny Wang
eb4b07ee1d [fuchsia] Bump Fuchsia's API level to 16 (flutter/engine#50358)
Update Fuchsia's API level to 16.

b/322503140


## 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-02-06 15:34:37 +00:00
Taha Tesser
5f93393312 Fix iOS password autofill prompt dismissal causes layout to resize (flutter/engine#50364)
fixes [Save password prompt dismiss is pushing UI up and down](https://github.com/flutter/flutter/issues/112281)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

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

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final TextEditingController controller1 = TextEditingController();
  final TextEditingController controller2 = TextEditingController();

  @override
  void dispose() {
    controller1.dispose();
    controller2.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold( // Replace Scaffold with Material to fix glitch.
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            const Text('Login (Without Scaffold)'),
            AutofillGroup(
              child: Column(
                children: <Widget>[
                  TextField(
                    controller: controller1,
                    autofillHints: const <String>[AutofillHints.username],
                  ),
                  TextField(
                    controller: controller2,
                    autofillHints: const <String>[AutofillHints.password],
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
```

</details>

### Before

https://github.com/flutter/engine/assets/48603081/dfe36616-e1dd-4c6c-95b0-e4bd89bd3a6a

### After

https://github.com/flutter/engine/assets/48603081/cfb15252-10cd-4521-a1ef-2cace0004588

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-05 21:53:03 +00:00
LongCatIsLooong
0c52de1fda visiblePassword uses ASCII keyboard on iOS (flutter/engine#50293)
Fixes https://github.com/flutter/flutter/issues/129113

The documentation states that the `visiblePassword` input type
> Requests a keyboard with ready access to both letters and numbers.

`UIKeyboardTypeASCIICapable` seems to be the closest match.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-05 21:34:09 +00:00
Dan Field
b763483b43 [Impeller] Do not reference this in the submit callback for Metal GPU Surfaces (flutter/engine#50361)
Fixes https://github.com/flutter/flutter/issues/141351 (speculatively - I have not directly reproduced this in an application, but without this change the added test crashes with a segfault in the submit callback).

If the rasterizer gets torn down, the surface gets released and the submit callback may fire on a collected object. Capturing `this` isn't safe. I'm not quite sure how that could happen from the linked stack trace though, since the draw call and the teardown call should be happening on the raster thread, and if the surface was reset then the draw call should've failed earlier...

The added test causes a segfault without the change.
2024-02-05 20:58:17 +00:00
Zachary Anderson
c5eac677ca Revert "[Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds" (flutter/engine#50291)
Reverts flutter/engine#50058 for
https://github.com/flutter/flutter/issues/142811
2024-02-02 11:40:10 -08:00
Bart Cone
1b95fed6c0 [Android] Fix TextInputType.none for devices with physical keyboard (flutter/engine#49980)
## Description

This PR fixes an issue where keystrokes aren't received on Android
devices with physical keyboards (e.g. rugged Zebra devices) when
`keyboardType` is set to `TextInputType.none` on a `TextField`.

The logic in `setTextInputClient` and `canShowTextInput` created an
`inputTarget` with `InputTarget.Type.NO_TARGET` which caused the [input
connection to short
circuit](https://github.com/flutter/engine/blob/main/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java#L296)
and not be established.

Bug introduction PR: https://github.com/flutter/engine/pull/26585

## Related Issue

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

## Unit Test Notes

- The existing `showTextInput_textInputTypeNone()` stays green after
update.
- `inputConnection_textInputTypeNone()` updated to `assertNotNull`. I
would make this more specific, but this is my first venture into the
Flutter engine and don't know enough about those connection attributes.

## Demo

Video below with Zebra MC9300 device. This issue can also be reproduced
in a standard android emulator. Simply add a `TextField`, configure
`keyboardType` to be `TextInputType.none` and attempt to enter text
after running and giving focus to textfield.

Before


https://github.com/flutter/engine/assets/1988098/348ca061-b8b9-4483-956e-0732c1238207

After


https://github.com/flutter/engine/assets/1988098/b65c7251-59b4-4c73-9b85-7ac03f47a7e4

## 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
2024-02-01 23:24:39 -08:00
Michael Goderbauer
2134c852b4 Re-add tests deleted on accident (flutter/engine#50223)
This re-adds the tests from https://github.com/flutter/engine/pull/41998/files that were accidentally deleted in https://github.com/flutter/engine/pull/42418/files#diff-2cce780ae0f93b9230cbf44030048dbf9ef4c6e0fdb959a47cae440fac0350faL808, probably because of a bad merge.
2024-02-01 21:51:51 +00:00
John McCutchan
7c04b55f07 Provide a more helpful error message in the case of UnsatisfiedLinkError (flutter/engine#50247)
Related https://github.com/flutter/flutter/issues/83596
2024-02-01 11:04:45 -08:00
Loïc Sharma
5251e0048f Reland "[Windows] Introduce egl::Surface and egl::WindowSurface" (flutter/engine#50148)
# Original pull request description

This introduces the `egl::Surface` and `egl::WindowSurface` types to abstract a raw `EGLSurface`. This also removes some - but not all - EGL surface logic out from `EGLManager`.

Subsequent pull requests will be necessary to:

1. Move ownership of the `egl::WindowSurface` from `egl::Manager` to `FlutterWindowsView`
2. Refactor external texture's off-screen EGL surface to use `egl::Surface`

Part of https://github.com/flutter/flutter/issues/141996

# Reland

https://github.com/flutter/engine/pull/49983 was reverted as it introduced a crash if the render surface fails to be created even though EGL was initialized successfully.

This pull request is split into the following commits:

1. c0b11be79f is the original pull request unchanged
2. 1dc7813845 is the fix: it checks a surface is valid before using it. This also adds several tests to prevent this kind of regression.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-01 17:08:15 +00:00
Jonah Williams
0682efb50f [Impeller] size vk swapchain to window size. (flutter/engine#50205)
The size the engine recieves from the `AndroidSurfaceVulkanImpeller::OnScreenSurfaceResize` appears to be correct in the case of window rotation. Use this instead of physical surface properties to set the swapchain image size.

Querying the physical surface properties seems to have some additional non-deterministic delay. This means that querying the properties during a window rotation will frequently return old values.

Fixes https://github.com/flutter/flutter/issues/138780
Fixes https://github.com/flutter/flutter/issues/132708
2024-02-01 03:45:07 +00:00
Robert Ancell
bd70ef1215 Remove string field from FlKeyEvent (flutter/engine#50189)
This field is deprecated in GTK3 [1] and not used in Flutter. It does
not exist in GTK4.

[1] https://docs.gtk.org/gdk3/struct.EventKey.html
2024-02-01 16:17:19 +13:00
Jonah Williams
c403a9f417 [Impeller] make GPU tracing off by default. (flutter/engine#50215)
Fixes https://github.com/flutter/flutter/issues/141788
Fixes https://github.com/flutter/flutter/issues/141798

Disable GPU tracing by default.
2024-02-01 00:55:33 +00:00
Jenn Magder
12dc7ef814 Log FlutterJSONMessageCodec decode errors before asserting (flutter/engine#50163)
Logging JSON decode errors on assertion will help track down bugs.
https://github.com/flutter/flutter/issues/100891#issuecomment-1915946340

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 17:31:00 +00:00
zijiehe@
b2d8969566 [Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds (flutter/engine#50058)
This change implements a BundledTestRunner to run most of the tests in testing/fuchsia/test_suites.yaml as ExecutableTestRunner.

- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.

The BundledTestRunner can share most of the logic in ExecutableTestRunner and avoid reinventing the wheel.

This change also fixes the build break of fuchsia_tests in fuchsia_release_x64 which allows tests to run on the build as well.

- Tests not built with AOT are filtered out with variant field in test_suites.yaml.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 05:39:21 +00:00
Martin Kustermann
891ac4e5bd More correctly name methods regarding event loop that are currently named microtask (flutter/engine#50138)
Flutter implements the UI isolates message via posting to a UI task queue. That task queue has a primary and a secondary queue. The

* primary is used for running tasks resulated to framework (e.g. draw frame)
* secondary is used to run Dart event loop messages (e.g. received data on a socket)

The Dart semantics requires running microtasks before processing the next event loop message.

The way flutter implements by attaching an observer to the secondary queue. Every time a task from the queue is run, all observers are run and one of them is going to run pending microtasks.

In some situations the engine pauses the dart event loop. The terminology used in the code is "microtask" when in reality what it means is "event loop".

=> This PR changes this terminology to reflect what actually happens.
2024-01-31 04:41:28 +00:00