5205 Commits

Author SHA1 Message Date
Jonah Williams
24c6a07906 [Impeller] Add support to embedder for Impeller on GL (via Angle on Windows). (flutter/engine#43388)
Actually works now, though there is some issue with the default fbo stencil so I've filled https://github.com/flutter/flutter/issues/130048

Other issues:
* ~~Rendering looks wrong~~
* ~~Resizing window hangs~~
* ~~Reactor isn't set up correctly and all blit passes are currently failing.~~
* ~~Needs to handle falling back to sample count of 1 like we do on Android~~.
2023-07-13 00:34:34 +00:00
Jim Graham
ce4c7d3ffd move rtree and canvas_spy sources to Fuchsia sub-directory (flutter/engine#43615)
These sources have long been obsolete for most of the engine, except for the Fuchsia sources. They do not need to be built for any other platform so this PR moves them into a Fuchsia platform-specific build directory so that they are only present in the Fuchsia binaries.
2023-07-12 22:22:39 +00:00
Jim Graham
870fc78163 header file cleanup focusing on removing unnecessary SkPicture includes (flutter/engine#43589)
Most of the #include directives for SkPicture are removed except where they are still functional. Many comments rewritten to no longer be SkPicture-centric.

- DL unit tests still use it for consistency testing
- rasterizer/engine still use it for screen shot support
- Fuchsia still uses it extensively
2023-07-12 08:17:06 +00:00
Gwen Mittertreiner
91de8eabaa [fuchsia][cml] Mark Tracing as Optional (flutter/engine#43567)
Tracing is an optional component that is only included in eng builds, so the usage should be marked optional.

Bug: fxbug.dev/112433
2023-07-11 20:24:06 +00:00
Dan Field
9062f9858c Delete unused display list/SkPicture code (flutter/engine#43560)
This code no longer does anything.
2023-07-11 17:15:47 +00:00
David Worsham
122b633929 [fuchsia] Remove FIDL dart references (flutter/engine#43550)
fidlgen_dart was still referenced in the build rules. It is being
removed from the fuchsia SDK, so remove it from the build rules here.
2023-07-12 02:48:12 +10:00
Jim Graham
b9835fa1b8 remove include of SkPicture files from non-Fuchsia sources (flutter/engine#43542)
Addresses most of https://github.com/flutter/flutter/issues/128060

Most of the uses of SkPicture and Recorder are removed from the engine sources. The few that remain are:

- DisplayList <-> Skia consistency testing code
- Legacy code only used from Fuchsia
- Dart CanvasKit uses which aren't actually using the local Skia sources or libraries

These are all comment and include file changes and so the testing is in the building.
2023-07-11 09:22:19 +00:00
Robert Ancell
1f3d51dca5 Use better method of ensuring that *_get_type() functions are exported (flutter/engine#43395)
As discovered in https://stackoverflow.com/a/63264068/1950237
2023-07-11 07:58:34 +12:00
luckysmg
4248f33948 [iOS][Keyboard] Reland wait vsync on UI thread and update viewport inset to avoid jitter (flutter/engine#43463)
*List which issues are fixed by this PR. You must list at least one issue.*
- https://github.com/flutter/flutter/issues/120555
- https://github.com/flutter/flutter/issues/130028

### New test for crash case: 
`testKeyboardAnimationWillNotCrashWhenEngineDestroyed`

### The diff with original PR:

Use `dispatch_async(dispatch_get_main_queue()` to switch to platform thread.
2023-07-10 16:25:05 +00:00
Robert Ancell
b864ee7e61 Fix leak when switching channels (flutter/engine#41827)
As noticed in https://github.com/flutter/flutter/issues/126209

## 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 Hixie said 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.
2023-07-10 21:54:21 +12:00
Dan Ballard
ac192f333c [linux] Allow overriding aot_library_path (flutter/engine#42555)
Support overriding `aot_library_path` in `FLDartProject` on Linux.

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

## 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 Hixie said 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
[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
2023-07-10 16:11:53 +12:00
Tong Mu
489f9c3d01 Make updating window metrics multi-view (flutter/engine#43366)
This PR adds multi-view support to various methods that updates the window metrics by adding a `view_id` parameter.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-08 05:54:16 +00:00
Tong Mu
9cd4338940 Rename default views to implicit views (flutter/engine#43364)
This PR renames a number of internal variables from "default view ID" to
"implicit view ID", as we have pretty much settled on naming this
mechanism. Some docs are also fixed accordingly.

## 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 Hixie said 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
[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
2023-07-07 20:44:37 -07:00
David Worsham
b400037017 [fuchsia] Fix tests; remove fuchsia dart SDK deps (flutter/engine#43461)
Dart is being removed from the Fuchsia SDK, so remove references to it
here.

Also remove references to workstation_eng and replace with terminal.
workstation_eng is no longer a thing.
2023-07-08 09:37:34 +10:00
John McCutchan
2f7b05c650 Eagerly remove the PlatformView from the view hierarchy on Android (flutter/engine#43423)
Eagerly remove the PlatformView from the view hierarchy on Android.

Fixes [#107297](https://github.com/flutter/flutter/issues/107297)

## 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 Hixie said 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.
2023-07-06 15:28:10 -07:00
Tong Mu
f4bd2708cf Remove dead code for recreating a11y node delegates (flutter/engine#43359)
This PR removes some dead code for recreating a11y node delegates. These
code was used to refresh a11y information when the macOS embedder live
swapped view controllers, but have become obsolete since
https://github.com/flutter/engine/pull/39145 removed the support for
such live swapping.

## 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 Hixie said 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
[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
2023-07-06 13:10:02 -07:00
Loïc Sharma
27e0ef62d8 [macOS] Fix assertion typo (flutter/engine#43179) 2023-07-06 20:02:18 +00:00
LouiseHsu
9e79a79066 Add Look Up to iOS selection controls (flutter/engine#43308)
In native iOS, when Look Up is initiated on highlighted text, a view DDParsecCollectionViewController is presented with definitions of the the selected text if available, as well as Siri integrated suggestions. However, since the view controller is gated behind a private API, we will use [UIReferenceLibraryViewController](https://developer.apple.com/documentation/uikit/uireferencelibraryviewcontroller) instead, which is functionally identical and visually very similar.

| Native | UIReferenceLibraryViewController|
| ------------- | ------------- |
| <img src="https://github.com/flutter/engine/assets/36148254/763004f0-970f-4d8a-9a9a-133401ef0c1b" width="360" />| <img src="https://github.com/flutter/engine/assets/36148254/b20fe03f-6c9d-4a4a-98dc-8bcd840406db" width="360" />|

This PR is the engine portion of the changes that will allow this feature change.
This PR addresses https://github.com/flutter/flutter/issues/82907
More details are available in this [design doc](flutter.dev/go/add-missing-features-to-selection-controls)
2023-07-06 19:38:48 +00:00
Chris Yang
f265745bc2 Revert "[iOS][Keyboard] Wait vsync on UI thread and update viewport inset to avoid jitter." (flutter/engine#43422)
Reverts flutter/engine#42312

Original PR caused crash https://github.com/flutter/flutter/issues/130028

Will reopen https://github.com/flutter/flutter/issues/120555
2023-07-06 17:33:07 +00:00
Dan Field
f7ba78c7b0 Release log capture at end of test (flutter/engine#43429)
Fixes https://github.com/flutter/flutter/issues/130036

Also fixes a potential issue where the shell wasn't getting destroyed at the end of the test.

Since no log is actually printed ont he second go, the destructor of `LogMessage` never clears the static pointer, and the next test that tries to print a log tries to print to that pointer which is now garbage.
2023-07-06 15:05:01 +00:00
yaakovschectman
017941c97d Use Windows Display Language (flutter/engine#43341)
Get the Windows Display Language for locale selection instead of the
preferred languages.

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

## 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 Hixie said 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 `///`).
- [ ] 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
[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: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-07-06 07:49:50 -04:00
Loïc Sharma
8bc45a996f [Windows] Fix FlutterWindow::GetNativeViewAccessible crash (flutter/engine#43368)
Flutter shouldn't crash if a view's `HWND` receives a `WM_GETOBJECT` message before it is attached to the view.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-05 17:27:03 +00:00
林洵锋
45ac2b64e6 [iOS] Fix FlutterViewController retain cycle (flutter/engine#43379)
Fixes [flutter/flutter#126560](https://github.com/flutter/flutter/issues/126560)
2023-07-05 17:00:18 +00:00
yaakovschectman
570578974c Fix inverted boolean in Windows document selection changed a11y event (flutter/engine#43281)
Fix a typo that inverted an intended condition, and amend a unit test to
check for this. This a11y event should target the focused node, but a
fallback for when the focus returns null was inverted.

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

## 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 Hixie said 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 `///`).
- [ ] 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
[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: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-06-30 12:10:37 -04:00
Brandon DeRosier
cd52c0ce82 Revert "Reland "add non-rendering operation culling to DisplayListBuilder" (#41463)" (flutter/engine#43358)
Reverts flutter/engine#42584. (Thanks to @jonahwilliams for bisecting)

With this change, layers are getting clipped incorrectly when rendering
platform views in Wondrous.
2023-06-30 04:22:21 -07:00
Tamir Duberstein
e4d08d4e8c Remove unused constants (flutter/engine#43344) 2023-06-29 21:42:05 +00:00
Emircan Uysaler
d69d614045 [fuchsia] Remove strict equality check for SkMatrix comparison for Fl… (flutter/engine#43309)
Flatland version of
010e710512

Bug: fxb/126648
2023-06-29 12:01:12 -04:00
Jonah Williams
ac3ce651f3 [Impeller] Give Impeller a dedicated raster priority level worker loop. (flutter/engine#43166)
We'd like to (or already are) using the concurrent message loop for high priority rendering tasks like PSO construction and render pass encoding. The default priority level for the engine managed concurrent message loop is 2, which is a significantly lower priority than the raster thread at -5. This is almost certainly causing priority inversion.

We must move back to dedicated runners so we can adjust thread priorities.
2023-06-27 18:08:49 +00:00
Tamir Duberstein
da738cb44d Avoid channel clone (flutter/engine#43181)
Use fdio_fd_transfer instead of fdio_fd_clone.
2023-06-26 12:04:46 -07:00
Robert Ancell
2e4569257b Allow event channels to reuse names (flutter/engine#41837)
https://github.com/flutter/flutter/issues/126209

## 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 Hixie said 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.
2023-06-26 14:05:34 +12:00
Brandon DeRosier
c85223dc95 [Impeller] Supply surface cull rect for Vulkan & GLES dispatchers (flutter/engine#43152)
Similar to Metal, have the DL cull entities early that lie entirely
outside the surface texture.
2023-06-24 15:46:14 -07:00
Tamir Duberstein
f7d1aada2e Add tmp storage capability to flutter runner (flutter/engine#43157)
Missed in fd56ab9e4475893d94e3a45ea5d5b3374bd74447.
2023-06-23 16:33:42 -07:00
gmackall
805cd4816d Add a note in ImeSyncDeferringInsetsCallback explaining the reason behind capturing the latest final inset state (flutter/engine#43109)
Solely documentation change to explain the reasoning behind the change in https://github.com/flutter/engine/pull/42700.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-23 14:21:55 +00:00
utzcoz
23d3ca2e2b [android]: Make Robolectric tests work with SDK 33 (flutter/engine#42965)
Make Robolectric tests work with SDK 33. The Robolectric doesn't support create presentation window now, so this CL also adds a custom presentation shadow to hook showing state to make related tests work.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-22 20:33:57 +00:00
Lau Ching Jun
574191ed36 Workaround a release blocker after libc++ change (flutter/engine#43091)
The code breaks in C++20 mode after libc++ removes comparisons for `std::vector` and replaces them with 'operator <=>'.

See cl/542541552 for context.
2023-06-22 19:33:44 +00:00
Dan Field
b6fa0a20a5 Print a warning when a message channel is used on the wrong thread. (flutter/engine#42928)
Fixes https://github.com/flutter/flutter/issues/128746

Prints a warning the first time a platform channel sends a message from the wrong thread with instructions/link to the site about how to fix this.
2023-06-22 18:16:40 +00:00
Tamir Duberstein
fd56ab9e44 Remove process-local tempfs (flutter/engine#43056)
This was incorrectly made read-only in 0984c52a8f; instead of implementing it locally, ask the component manager for the directory.
2023-06-22 02:46:23 +00:00
Bruno Leroux
8aff00a5d8 [Android] Return the keyboard pressed state (flutter/engine#42758)
## Description

This PR updates the Android engine in order to answer to keyboard pressed state queries from the framework (as implemented in https://github.com/flutter/flutter/pull/122885).

This is a rework of https://github.com/flutter/engine/pull/41695 which was reverted in https://github.com/flutter/engine/pull/42346.

This issue with https://github.com/flutter/engine/pull/41695 was that the framework side did not get an answer when the channel was setup in the engine without registering a handler (on the engine side) to handle framework requests. The issue was reproducible when the engine initialization was managed by the app (see https://github.com/flutter/flutter/issues/122441#issuecomment-1582052616 for a repro).

This PR fixes this issue by changing `flutter/keyboard` lifecycle: the engine now creates the channel and registers a handler just after the channel creation.
In order to avoid regression, this PR also updates the channel implemenation (see `KeyboardChannel`) to return an empty `HashMap` when there is no handler registered.

## Related Issue

Android engine implementation for https://github.com/flutter/flutter/issues/87391
(see https://github.com/flutter/engine/pull/42346 for Linux implementation)
Fixes https://github.com/flutter/flutter/issues/122441

## Tests

Adds 3 tests.
2023-06-21 05:49:06 +00:00
Bruno Leroux
d4326f7b08 [Linux] Allow BasicMessageChannel sending and responding to null message (flutter/engine#42808)
## Description

This PR changes how a null message is handled by the Linux engine for a basic message channel.

**Before**:

- when receiving a null message a warning was emitted.
- `fl_binary_messenger_send_response` was called but failed and the application exited.

```
** (bug:9866): WARNING **: 23:13:42.109: Failed to decode message: Unexpected end of data

** (bug:9866): CRITICAL **: 23:13:42.109: gboolean send_response(FlBinaryMessenger *, FlBinaryMessengerResponseHandle *, GBytes *, GError **): assertion 'response_handle->response_handle != nullptr' failed
```

**After**:

- Receiving a null message is handled as expected from the framework side documentation:

9287e81d52/packages/flutter/lib/src/services/platform_channel.dart (L149-L150)

## Related Issue

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

## Tests

Adds 2 tests.
2023-06-15 13:04:00 +00:00
Chris Yang
57582c3dd0 [ios] use interfaceOrientation orientation on iOS 13 and above (flutter/engine#42846)
The UIApplication.statusBarOrientation is deprecated on iOS 9. The replacement is UIScene.interfaceOrientation, which is available on iOS 13 and above. See: https://developer.apple.com/documentation/uikit/uiapplication/1623026-statusbarorientation?language=objc

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-14 22:33:07 +00:00
Chris Yang
c0a630899e [ios] view controller based status bar (flutter/engine#42643)
UIApplication based status bar API was deprecated.

This PR makes the ViewController based status bar appearance the default.
Still keep UIApplication based status bar for apps that explicitly sets `UIViewControllerBasedStatusBarAppearance` to NO in info.plist.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-14 19:27:23 +00:00
Chris Yang
cc1ec72179 Remove some trivial deprecated symbol usages in iOS Embedder (flutter/engine#42711)
stringWithCString was deprecated in iOS 2.0
UIAccessibilityVoiceOverStatusChanged was deprecated in iOS 11.0

fixes: https://github.com/flutter/flutter/issues/128732
https://github.com/flutter/flutter/issues/128736

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-13 22:26:59 +00:00
Chris Yang
4f88b3f075 Reland "[ios_platform_view] only recycle maskView when the view is applying mutators #42115" (flutter/engine#42823)
Relands https://github.com/flutter/engine/pull/42115, which was reverted in https://github.com/flutter/engine/pull/42231 due to a crash in the framework test.

The crash is due to a memory management issue that I fixed it in this PR, I also added a scenario test to catch the crash.

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

See also: orignal PR https://github.com/flutter/engine/pull/41573 for more details.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-13 22:14:06 +00:00
Jonah Williams
5d79671f0e [Impeller] Reland attempt Vulkan setup and fallback to GLES. (flutter/engine#42820) 2023-06-13 21:46:09 +00:00
Tamir Duberstein
75da76c7cd Add missing includes (flutter/engine#42812)
See https://fxrev.dev/869997.
2023-06-13 19:34:06 +00:00
luckysmg
948e1fa81a [iOS][Keyboard] Wait vsync on UI thread and update viewport inset to avoid jitter. (flutter/engine#42312)
Video for after and before this patch:
[videos.zip](https://github.com/flutter/engine/files/11231756/videos.zip)

- https://github.com/flutter/flutter/issues/120555

The technical problem is: if setViewportMetrics called **before** framework's vsync process callback (rebuild & layout & paint), will cause jitter keyboard animation.So this PR is to keep the time when updateViewportMetrics call to framework side legal.

### Before
![2](https://github.com/flutter/engine/assets/49340347/71198a08-b139-4d6d-87e1-37e536f5d34b)

### After
![1](https://github.com/flutter/engine/assets/49340347/5c9df757-7e39-4855-8c3a-009f5d6438b2)
2023-06-13 17:40:05 +00:00
gmackall
04786833e9 Capture additional final inset states in ImeSyncDeferringInsetsCallback (flutter/engine#42700)
Fixes https://github.com/flutter/flutter/issues/118761.

For some context: ImeSyncDeferringInsetsCallback extends [WindowInsetsAnimation.Callback](https://developer.android.com/reference/android/view/WindowInsetsAnimation.Callback) specifically to handle insets related to keyboard animations.

When a keyboard animation happens, we get a call to onPrepare with the animation, and then to onApplyWindowInsets with [WindowInsets](https://developer.android.com/reference/android/view/WindowInsets) that represent the post animation state. For example, for hiding the keyboard, we would get WindowInsets with height of 0 for insets of type WindowInsets.Type.ime() (input method editor). We save these post-animation insets. 

We then get calls to onProgress for each frame of the animation, and use the WindowInsets passed to onProgress to build new WindowInsets based on the saved post-animation insets, but with the keyboard insets overridden by the WindowInsets passed to onProgress.

Finally, we get a call to onEnd, where we apply the saved insets.

However, there can be multiple animation running at the same time. For example, dismissing the keyboard can result in an animation associated solely with the keyboard happening, as well as an animation associated only with the navigation bar happening. And they can start at slightly different times. This can result in the situation described in this comment: https://github.com/flutter/flutter/issues/118761#issuecomment-1574284505

Re-setting needsSave to false ensures we don't ignore any updates to the final state, ensuring correct insets in onProgress and onEnd.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-06-13 17:10:33 +00:00
Justin McCandless
7ffe595a77 Predictive back breakage fix (flutter/engine#42789)
Fixes breakages related to setFrameworkHandlesBack, for the Predictive Back feature for Android.
2023-06-12 16:19:30 -07:00
Jonah Williams
260d931b1c [Impeller] allowing enabling Impeller on macOS. (flutter/engine#42639)
Ship it?
2023-06-12 20:02:46 +00:00
hellohuanlin
ab09f653a6 [floating_cursor_selection] a somewhat "design doc" for floating cursor feature (flutter/engine#42173)
This PR gives an overview of how floating cursor feature works (including the new floating cursor selection gesture, and the existing floating cursor move gesture). It can serve as the missing design doc. 

I put it in the engine rather than the framework, since all logics are in one place, and it's closer to the UIKit behavior that I want to cover. 

Thanks @moffatman for helping me understanding it. 

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

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

*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
2023-06-12 19:19:54 +00:00