5753 Commits

Author SHA1 Message Date
Dan Field
f235a65897 Avoid reloading font collection for spawned engines with compatible asset managers (flutter/engine#50897)
@jason-simmons @jiahaog fyi

I need to figure out a test for this still but it seems to work. Hot restart is kind of a mess though, because `Engine::Restart` nulls out the asset manager it ends up reloading the font collection for every engine after a restart. But we separately need to fix hot restart, it's not very usable on the example app 

Fixes https://github.com/flutter/flutter/issues/143701
2024-02-24 14:58:37 +00:00
Tong Mu
cb110ebc94 Reland 4: Multiview pipeline (flutter/engine#50931)
This relands https://github.com/flutter/engine/pull/49950.

Nothing is changed. The error turns out a flake (it passes once),
although this PR might have made the flake more flaky.

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-02-23 20:52:53 -08:00
Loïc Sharma
788179d383 [Windows] Refactor the a11y announcement test (flutter/engine#50888)
This refactors the Windows accessibility announcement test. This will make it easier to add a headless variant of this test as 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-24 00:26:02 +00:00
Loïc Sharma
b73e827969 [Windows] Add helper for headless integration tests (flutter/engine#50885)
We'll add more headless mode tests as 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-23 23:23:29 +00:00
Zachary Anderson
9f1ed38ee0 Shift //third_party/icu to //flutter/third_party (flutter/engine#50924)
For https://github.com/flutter/flutter/issues/67373
2024-02-23 23:23:27 +00:00
auto-submit[bot]
c388fc8bf0 Reverts "Reland 3: Multiview pipeline (#49950)" (flutter/engine#50929)
Reverts flutter/engine#49950

Initiated by: dkwingsmt

Reason for reverting: Head redness 
```
java.lang.RuntimeException: Timeout waiting for firstFrameLatch to signal
	at dev.flutter.scenarios.ExternalTextureFlutterActivity.waitUntilFlutterRendered(ExternalTextureFlutterActivity.java:98)
	at dev.flutter.scenariosui.ScreenshotUtil.capture(ScreenshotUtil.java:122)
```

Original PR Author: dkwingsmt

Reviewed By: {loic-sharma}

This change reverts the following previous change:
Original Description:
This is the 3rd attempt to land multiview pipeline, following
https://github.com/flutter/engine/pull/47239.

The pipeline now properly implements the required logic for
`scheduleWarmUpFrame` to work in a multi-view setup, following the
preparation in https://github.com/flutter/flutter/pull/143290 and
https://github.com/flutter/engine/pull/50570.

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2024-02-23 15:15:00 -08:00
Dan Field
7fd214252c Remove timeouts from CountdownLatch.await in tests (flutter/engine#50930)
See
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#never-check-if-a-port-is-available-before-using-it-never-add-timeouts-and-other-race-conditions

This may be contributing to flakiness in the Java/Scenario_app tests. We
should just timeout when CI says it's taken too long - on a slow machine
5 or 10 seconds may not be enough time.
2024-02-23 15:10:16 -08:00
Tong Mu
dd271d0880 Reland 3: Multiview pipeline (flutter/engine#49950)
This is the 3rd attempt to land multiview pipeline, following
https://github.com/flutter/engine/pull/47239.

The pipeline now properly implements the required logic for
`scheduleWarmUpFrame` to work in a multi-view setup, following the
preparation in https://github.com/flutter/flutter/pull/143290 and
https://github.com/flutter/engine/pull/50570.

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-02-23 13:39:54 -08:00
Victoria Ashworth
eaa52fc3e0 Build macOS engine as an xcframework (flutter/engine#50300)
Creates and adds FlutterMacOS.xcframework to out/mac or out/host.

Creates and archives FlutterMacOS.xcframework when building mac_host_engine. Archives the xcframework in a new zipped folder at `darwin-x64/framework.zip`, `darwin-x64-profile/framework.zip`, `darwin-x64-release/framework.zip`.

The FlutterMacOS.framework is also still archived currently - I thought it'd be better to keep it archived so we don't have to worry about the tool breaking until we're ready to remove it.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-22 21:37:46 +00:00
auto-submit[bot]
ab20c1255c Reverts "Remove WindowManager reflection in SingleViewPresentation.java (#49996)" (flutter/engine#50873)
Reverts flutter/engine#49996

Initiated by: gmackall

Reason for reverting: b/326363243 

Original PR Author: gmackall

Reviewed By: {johnmccutchan, reidbaker}

This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/106449. Changes it to a static proxy, as the comment recommended. This does mean we will have to update it to override new methods as they are added to the interface when updating the version of the Android sdk we use.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-22 18:07:17 +00:00
Tong Mu
c5e0858a01 Add scheduleWarmUpFrame (flutter/engine#50570)
This PR adds `PlatformDispatcher.scheduleWarmUpFrame`.

This PR is needed for the follow up changes:
* The framework will switch to using this function to render warmup
frames in https://github.com/flutter/flutter/pull/143290.
* Then the engine will finally be able to switch to multiview pipeline
with no regression on startup timing in
https://github.com/flutter/engine/pull/49950.

For why the warm up frame must involve the engine to render, see
https://github.com/flutter/flutter/issues/142851.


## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-02-21 16:46:11 -08:00
Gray Mackall
583017ec69 Make Android Studio be able to run android embedding unit tests out of the box (flutter/engine#50840)
This is pretty rough, it largely copies the configuration from the `test_runner/build.gradle`. 

But it lets me click and run unit tests without having to rebuild anything, which is nice:

example
<img width="1537" alt="Screenshot 2024-02-21 at 2 44 19 PM" src="https://github.com/flutter/engine/assets/34871572/a48a14dd-b43e-4bd5-a375-3b44e058d0f6">

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-21 23:51:18 +00:00
Zachary Anderson
e6d9dca1b7 Shift some deps to //flutter/third_party (flutter/engine#50830)
Part of https://github.com/flutter/flutter/issues/67373
2024-02-21 23:51:16 +00:00
Chris Bracken
150019dccb [macOS] Wrap FlutterEngineTest in autoreleasepool (flutter/engine#50832)
Previously, these were not freeing allocations. This resulted in a lot
of running engines/threads which triggered issues with running out of
resources (Metal resources in particular).

This also re-enables two disabled unit tests for view background colour.

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

## 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 at least one completely unnecessary checkbox.
- [X] J'ai ajouté une case à cocher dans une langue autre que l'anglais.
- [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-21 15:01:57 -08:00
Loïc Sharma
4865589c11 [Windows] Fix top-level message procedure order (flutter/engine#50797)
The Windows embedder registers "message procedures" to handle to top-level window events. These message procedures should be called in the order that they are registered.

For example, a plugin can override the embedder's app lifecycle behavior by registering a message procedure before the embedder's app lifecycle message procedure.

This did not always work as expected as the message procedures were ordered by their pointers instead of their insertion order.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-21 22:52:50 +00:00
John McCutchan
98d7553cd8 Tweak verbose log messages in ImageReaderSurfaceProducer (flutter/engine#50831)
- Tweak log output.
- Increase MAX_IMAGES from 4 to 5 to avoid a JNI warning message in the
common case.
2024-02-21 13:42:19 -08:00
Jason Simmons
55da4fb37d Make the GL context current in EmbedderSurfaceGLImpeller before creating the GPU surface (flutter/engine#50807)
The GPUSurfaceGLImpeller ctor creates an AiksContext/ContentContext, which loads the shader pipelines.  If the current thread does not have a GL context and can not execute ReactorGLES operations, then the pipeline futures will not complete.  This can cause the raster thread to hang if the reactor has not run and the futures are still incomplete when a rendering task later needs to obtain the pipeline.
2024-02-21 18:37:21 +00:00
Gray Mackall
a64eabf997 Remove WindowManager reflection in SingleViewPresentation.java (flutter/engine#49996)
Fixes https://github.com/flutter/flutter/issues/106449. Changes it to a static proxy, as the comment recommended. This does mean we will have to update it to override new methods as they are added to the interface when updating the version of the Android sdk we use.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-21 18:31:31 +00:00
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