@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
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
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
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
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.
- 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
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.
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
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
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
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.
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.
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.
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
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.
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.