5433 Commits

Author SHA1 Message Date
John McCutchan
6a0fe28dac Restrict ImageReader backed Platform Views to Android 33+ (flutter/engine#46478)
This is necessary to be able to access the fence associated with each
frame that is produced. This API is not available below 33.
2023-10-02 19:23:51 -06:00
Bruno Leroux
2475a550db [Linux] Rename 'set_allow_channel_overflow' to 'set_warns_on_channel_… (flutter/engine#46360)
## Description

This PR is a follow-up to https://github.com/flutter/engine/pull/44636 which introduces the `set_allow_channel_overflow` function. It renames this function to `set_warns_on_channel_overflow`.

The previous naming was inspired by the framework side implementation.
c00c022036/lib/ui/channel_buffers.dart (L574)

During the review of the iOS/macOS implementation, https://github.com/flutter/engine/pull/44848#discussion_r1310463864, we agreed that the existing naming is confusing because it implies that overflow will be allowed, but this not the case this function is used to enable/disable error messages when a channel overflows. 

## Related Issue

Follow-up for https://github.com/flutter/flutter/issues/132386.

## Tests

Updates 2 tests.
2023-10-02 05:36:16 +00:00
John McCutchan
af107ceba5 Add an AndroidManifest.xml flag to disable ImageReader backed Platform Views (flutter/engine#46430)
An internal customer is seeing flickering on some high FPS phones.

While we try and reproduce / gain more knowledge of this problem this PR adds a AndroidManifest.xml flag to disable their usage.

The boolean flag is:
```
"io.flutter.embedding.android.DisableImageReaderPlatformViews"
```

Adding the following to your manifest will disable their usage:

```
<meta-data
  android:name="io.flutter.embedding.android.DisableImageReaderPlatformViews"
  android:value="true" />
```
2023-09-30 00:33:33 +00:00
Casey Hillers
f61c3b45a2 Disable enableHardwareBufferRenderingTarget (flutter/engine#46425)
* Causing flickering in web views
* Follow up of cl/569435819 for Google to unblock the rolls
2023-09-29 22:56:07 +00:00
Tong Mu
c7f206212a Multi-view Rasterizer (flutter/engine#45512)
This PR refactors `Rasterizer` so that it's more suitable for multi-view.

Design doc: [flutter.dev/go/multi-view-pipeline-and-rasterizer](http://flutter.dev/go/multi-view-pipeline-and-rasterizer)

With this change, `Rasterizer::DrawToSurfaces` has a structure that can handle drawing to multiple views, although the lack of some functionality still blocks it, mostly related to `ExternalViewEmbedder` and `RasterCache`. 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-29 21:43:55 +00:00
Matej Knopp
d4d0a41bd7 [macOS] Ensure first responder is consistent during and after text input (flutter/engine#46032)
Fixes https://github.com/flutter/flutter/issues/134906
Fixes https://github.com/flutter/flutter/issues/133832

This ensures that there are only two first responder widgets -
`FlutterView` when text input is not active and `TextInputPlugin` when
text input is active. The PR also prevents `FlutterView` stealing first
responder status on mouse click events during text input.

Previously when `TextInputClient` resigned it made `nextResponder` the
first responder, but that was incorrect - `nextResponder` being the
superview (`FlutterViewWrapper`).

## 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
2023-09-29 11:02:42 +02:00
Matej Knopp
fab42e688a Reland: [macOS] performKeyEquivalent cleanup (flutter/engine#46377)
Fixes the issue in original PR where `FlutterViewWrapper` does not pass the key equivalent to subviews thus prevents `TextInputPlugin` from receiving it. Also adds a regression test for this scenario.

Note that key equivalent flow does not respect the regular responder chain. It is passed from root view to down to subviews and if unhandled will be forwarded to menus.

Original message: 

https://github.com/flutter/engine/pull/40706 added a duplicate `NSEvent (KeyEquivalentMarker)` category. This PR removes it. It also removes the call to `markAsKeyEquivalent` from `FlutterViewController`. That call is internal to `FlutterTextInputPlugin` and classes outside should not be calling it.

*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-09-28 20:41:11 +00:00
Matej Knopp
839d6adae7 [macOS] TextInputPlugin should mark navigation events in IME popover as handled (flutter/engine#46141)
Fixes https://github.com/flutter/flutter/issues/134699

Because of NSTextInputContext API limitations it is not straightforward to determine whether `TextInputPlugin` has handled a text equivalent event or whether it should pass it on. Previously we marked all event  that didn't result in a TextInputClient action as unhandled, but that's does not work for arrow key events while the IME popover is active.

This PR will mark arrow keys event as handled if there is active composition.

*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-09-28 20:37:47 +00:00
Joel Winarske
40b832a838 [Impeller] Fix OpenGLES EGL_BAD_ACCESS due to context being current on multiple threads. (flutter/engine#46287)
On Linux setting the EGL context from one thread, then setting from another thread will trigger a EGL_BAD_ACCESS error.  The resolution is to clear the context after use on the thread that set it.

https://github.com/flutter/flutter/issues/130619
2023-09-28 20:10:09 +00:00
AJI
86b582a6bc Fix damage calculation when not providing populate_existing_damage for gl embedder (flutter/engine#45611)
# Description

This PR fixes the `gl_populate_existing_damage` in embedder.cc, which currently returns an empty rectangle when a full repaint is needed. This leads to the `frame_damage` being considered empty in rasterizer.cc, causing incorrect partial repaint within Flutter when `gl_populate_existing_damage` is not provided by the embedder.

# Related Issue

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

# Tests

Add a new test. Also fixes damage calculation related tests in EmbedderTest by

* Use a new Dart embedder fixture entry point `render_gradient_retained` which retains the old layer to make sure layer tree diff happens.
* Add `latch.Wait()` after `SetGLPresentCallback` to make sure assertions have been executed.
* Make `existing_damage_rects` static since it should be valid after `populate_existing_damage` returns.
2023-09-28 20:06:51 +00:00
Matej Knopp
c94d335b6b [macOS] FlutterTextInputPlugin should clip to bounds (flutter/engine#46142)
Fixes https://github.com/flutter/flutter/issues/135219
(formerly https://github.com/flutter/flutter/issues/128956)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-28 19:05:55 +00:00
Chris Bracken
87e27ff202 Revert "[macOS] performKeyEquivalent cleanup (#45946)" (flutter/engine#46374)
This broke some keyboard shortcut handling (e.g. cmd-a to select all).

This reverts commit 0deacc6c7023789c4a75155e6798b3cccdc6384a.


## 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
2023-09-28 10:45:11 -07:00
Matej Knopp
0deacc6c70 [macOS] performKeyEquivalent cleanup (flutter/engine#45946)
https://github.com/flutter/engine/pull/40706 added a duplicate `NSEvent (KeyEquivalentMarker)` category. This PR removes it. It also removes the call to `markAsKeyEquivalent` from `FlutterViewController`. That call is internal to `FlutterTextInputPlugin` and classes outside should not be calling it.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-28 17:28:47 +00:00
Bruno Leroux
f732952384 [Android] Rename allowChannelBufferOverflow to `setWarnsOnChannelOv… (flutter/engine#46361)
## Description

This PR is a follow-up to https://github.com/flutter/engine/pull/44434 which introduces the `allowChannelBufferOverflow` function. It renames this function to `setWarnsOnChannelOverflow`.

The previous naming was inspired by the framework side implementation.
c00c022036/lib/ui/channel_buffers.dart (L574)

During the review of the iOS/macOS implementation, https://github.com/flutter/engine/pull/44848#discussion_r1310463864, we agreed that the existing naming is confusing because it implies that overflow will be allowed, but this not the case this function is used to enable/disable error messages when a channel overflows. 

## Related Issue

Follow-up for https://github.com/flutter/flutter/issues/132386.

## Tests

Updates 1 test.
2023-09-28 14:08:12 +00:00
Chris Yang
e2bc37bba7 Reland "Reverts "[ios] Fix app extension not able to find assets from… (flutter/engine#46329)
Relands https://github.com/flutter/engine/pull/46283

The original PR had a bug where the relative assets path is reset after not being found in the `bundle`. It should not be reset unless it was not found inside the info.plist in `bundle`

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-28 00:02:04 +00:00
auto-submit[bot]
8a97e55da3 Reverts "[ios] Fix app extension not able to find assets from unloaded bundle" (flutter/engine#46328)
Reverts flutter/engine#46283
Initiated by: CaseyHillers
This change reverts the following previous change:
Directly use "flutter_assets" as the default path to find the asset path, this works for app extension when the bundle is unloaded.

This PR also adds integration tests for app extensions, which also tests the asset path. 

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-27 17:57:18 +00:00
Loïc Sharma
f020b2c7c9 [Windows] Improve logic to update swap intervals (flutter/engine#46172)
This relands https://github.com/flutter/engine/pull/45310 to unblock the ANGLE roll with the fix for https://github.com/flutter/flutter/issues/134262.

## Background

### Swap interval

If the Windows system compositor is enabled, the Windows embedder disables the swap interval so that presenting to a surface does not block until the v-blank. If the Windows system compositor is disabled (which is possible on Windows 7), the Windows embedder enables swap interval to prevent screen tearing.

### GL context threading

Our current version of ANGLE allows making a GL context current on multiple threads. However, the latest version of ANGLE errors if a GL context is made current on multiple threads. This is causing the ANGLE roll to fail ([example](https://ci.chromium.org/ui/p/flutter/builders/try/Windows%20Engine%20Drone/203788/overview)).

The Windows embedder has two GL context threading issues:

1. At startup, the platform thread creates and binds the GL context. This change ensures the GL context is released from the platform thread so that the raster thread can use the GL context for rendering.
2. When the system compositor updates, the GL context is bound to the platform thread to update the swap interval. This change ensures the swap interval update happens on the raster thread.

### Window resizing

Resizing the window recreates the GL surface and resets the swap interval.

The previous fix released the current GL context after updating the swap interval (this ensured the platform thread released the GL context at startup). This broke window resizing as it caused the engine to "lose" its GL context during rendering (see https://github.com/flutter/flutter/issues/134262). This reland releases the GL context only if on the startup case.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-27 17:52:17 +00:00
Jason Simmons
bfc3acee24 Declare native wrapper classes in Fuchsia packages as base classes (flutter/engine#46305)
This prohibits other implementations of the class interface that can not act as native wrappers.

See https://github.com/flutter/flutter/issues/123756
2023-09-27 15:44:58 +00:00
Matej Knopp
066459ce65 [macOS] Synchronise modifiers from mouse events for RawKeyboard (flutter/engine#46230)
Fixes https://github.com/flutter/flutter/issues/135349

This has been done for FlutterEmbedderKeyResponder in
https://github.com/flutter/engine/pull/37870, but has not been
implemented for FlutterChannelKeyResponder, which results in RawKeyboard
being out of sync with HardwareKeyboard.

## 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
2023-09-27 17:09:49 +02:00
Kevin Lubick
8656e6b1d4 Update to use GrDirectContexts::MakeGL (flutter/engine#46308)
This was added in https://skia-review.googlesource.com/c/skia/+/760017
and the old versions were deprecated.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] 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
2023-09-27 10:17:05 -04:00
Chris Yang
043c5a377a [ios] Fix app extension not able to find assets from unloaded bundle (flutter/engine#46283)
Directly use "flutter_assets" as the default path to find the asset path, this works for app extension when the bundle is unloaded.

This PR also adds integration tests for app extensions, which also tests the asset path. 

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-26 21:47:13 +00:00
Bruno Leroux
ce5194184d [Android] Fix enableSuggestions set to false not honored (flutter/engine#46037)
## Description

This PR fixes an issue where setting `TextField.enableSuggestions` to false was not honored on Android.

Several Android devices (Samsung) and/or IMEs (including GBoard) does not disabled suggestions when `InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS `flag is set. The common solution is to rely on the following flag:  ~~`InputType.TYPE_TEXT_VARIATION_PASSWORD`~~ `InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD`.

Reference:
- https://issuetracker.google.com/issues/36934423#comment4
- https://stackoverflow.com/questions/33148168/inputtype-type-text-flag-no-suggestions-in-samsung/33227237#33227237
- Existing comment on the codebase:
195a313245/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java (L270)

## Related Issue

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

## Tests

Adds 1 test.
2023-09-26 20:39:05 +00:00
Ian McKellar
a02355a95c fuchsia: Update FIDL for unknown interactions (flutter/engine#45773)
This is part of a language change in FIDL. This should have no effect.

See: [https://fxbug.dev/88366](https://fxbug.dev/88366)
2023-09-25 19:15:36 +00:00
Jonah Williams
f5ff960253 [Engine] use QoS classes in iOS engine. (flutter/engine#46265)
Hint to the CPU scheduler which of our threads are more important. This change should result in more stable rendering times on CI, but likely doesn't have any other observable effects.
2023-09-25 19:06:09 +00:00
Chris Yang
c889e14d4c [ios] Fix default assets url (flutter/engine#46214)
When reverting the default asset url code, the old "flutter_assets" path was also copied in https://github.com/flutter/engine/pull/46073
This PR uses the correct URL. Although I'm unsure why the video player test passed before my change for the asset urls. 

I'm going to take another look at it but meanwhile this PR can unblock the roll once rolled into the framework.

fixes of https://github.com/flutter/flutter/issues/135323

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-23 11:43:21 +00:00
Casey Hillers
27e8b0633d Revert "[Impeller] fail if software backend is chosen and Impeller is enabled on iOS" (flutter/engine#46217)
Reverts flutter/engine#46124

See b/301660190. This is breaking a few Google iOS tests due to test bed configurations. We'll need more time to investigate fixing those tests before relanding.
2023-09-23 02:15:50 +00:00
Jonah Williams
7cd7603dfa [Impeller] Reland: construct text frames on UI thread. (flutter/engine#46115)
Due to https://github.com/flutter/flutter/issues/127500 , we can get in a state where enable-impeller is true but we're using Skia. We need to either fall back completely to Skia, make this configuration fatal, or remote the check

----------------

Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged.

Removing this overhead is one of the goals of https://github.com/flutter/engine/pull/45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames.

This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first).

To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro. Across several runs this is a fairly consistent ~1ms raster time improvement.

Fixes https://github.com/flutter/flutter/issues/133204
2023-09-22 17:46:32 +00:00
Bruno Leroux
87139861e6 [iOS] Disable spelling corrections when auto correction is disabled (flutter/engine#46144)
## Description

This iOS PR disables spellchecking when auto correction is disabled.

## Related Issue

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

## Tests

Adds 1 test.
2023-09-22 06:00:58 +00:00
Dan Field
3ade44e1c7 [Impeller] fail if software backend is chosen and Impeller is enabled on iOS (flutter/engine#46124)
Fixes https://github.com/flutter/flutter/issues/127408

This is also related to https://github.com/flutter/engine/pull/44346, which made it fatal to explicitly request both impeller and the software backend.

Before landing this, we need to update some google internal tests that end up in this state to explicitly request Skia (or to get into a mode where they can actually use metal).
2023-09-22 00:31:00 +00:00
John McCutchan
72c674cc1c Re-enable HardwareBuffer backed Platform Views on Android >= 29 (flutter/engine#46071) 2023-09-21 14:40:31 -07:00
Tong Mu
38b8ce1c29 Reland: Enforce the rule of calling FlutterView.Render (#45300) (flutter/engine#45555)
This PR relands #45300 which was reverted in https://github.com/flutter/engine/pull/45525 due to hanging on a windows startup test. The culprit test still calls `FlutterView.render` in the illegal way, which is ignored, causing no frame being ever produced. This has been fixed in https://github.com/flutter/flutter/pull/134245. I've also searched through the framework repo for `render(` to ensure there are no other cases.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-21 21:11:03 +00:00
Matan Lurey
476b46954c Migrate from LOG_X to kLogX. (flutter/engine#46107)
These should be entirely non-breaking, i.e. 1:1 and same backing `int`
value.

(See https://github.com/flutter/engine/pull/46052)
2023-09-20 13:24:01 -07:00
Chris Yang
bc8e93271b [ios] fix asset url not found when loading app extension (flutter/engine#46073)
In b3fc48b91b, I refactored the assetsPath to use NSURL. It turns out that when the app bundle is not loaded (during launching app exgtension), the assetURL will return nil using the `URLForResource`, but the `pathForResource` successfully returns the raw path.

This PR reverts back to the raw path solution.

part of https://github.com/flutter/flutter/issues/124287

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-20 19:55:47 +00:00
Matan Lurey
792830c13f Make a variety of low-impact Clang tidy fixes. (flutter/engine#46114)
Work towards https://github.com/flutter/flutter/issues/134969.

These are all self-contained, so I bundled them all together.

All fixes are generated by `clang-tidy --fix`, and manual search/replace if that wasn't sufficient.
2023-09-20 19:52:03 +00:00
Jonah Williams
dc05767b39 [Impeller] Affinity adjustments for Vulkan backend. (flutter/engine#46063)
Runs the waiter threads with efficiency affinity and the worker thread with "not performance" affinity.
2023-09-19 23:34:11 +00:00
gaaclarke
8ddfb38703 [Impeller] adds hardware gate for wide gamut (flutter/engine#46051)
fixes https://github.com/flutter/flutter/issues/133015

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-19 22:27:36 +00:00
gaaclarke
70b4e83c3d Made the warning about downgrading wide gamut happen at the correct time (flutter/engine#46064)
fixes https://github.com/flutter/flutter/issues/135033

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-19 21:45:35 +00:00
Matan Lurey
42bac1a9a9 Conform to clang_tidy in client_wrapper headers. (flutter/engine#46058)
Partial work towards https://github.com/flutter/flutter/issues/134969.

All of these were auto-suggested by Clang, and mostly avoid unnecessary
copies.
2023-09-19 14:43:06 -07:00
Matan Lurey
4f1227c920 FlutterMouse.* -> kFlutterMouse.*, so we can lint header files. (flutter/engine#46056)
Partial work towards https://github.com/flutter/flutter/issues/134969.

---------

Co-authored-by: Chris Bracken <chris@bracken.jp>
2023-09-19 14:13:18 -07:00
Matan Lurey
3c7f8df584 Add TODO(name) to comply with Clang Tidy. (flutter/engine#46057)
Partial work towards https://github.com/flutter/flutter/issues/134969.
2023-09-19 12:54:08 -07:00
Matan Lurey
7ebcf75a46 Rename layoutGoals to kLayoutGoals to enforce lints on headers. (flutter/engine#46054)
This is required to eventually land https://github.com/flutter/flutter/issues/134969 (lint header files).
2023-09-19 17:58:33 +00:00
Bruno Leroux
195a313245 [macOS,iOS] Expose channel buffers 'resize' and 'overflow' control co… (flutter/engine#44848)
## Description

This PR update the helper function that invokes the control channel 'resize' command (previous implementation relied on a deprecated format). It also adds a similar helper function for the 'overflow' commands exposed by the control channel.

See:

c00c022036/lib/ui/channel_buffers.dart (L302-L309)

## Related Issue

iOS and macOS implementation for https://github.com/flutter/flutter/issues/132386

Similar implementations:
- Android: https://github.com/flutter/engine/pull/44434
- Linux: https://github.com/flutter/engine/pull/44636

## Tests

Adds two tests.
2023-09-19 09:40:18 +00:00
Jonah Williams
88e963e0fd [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673)
https://github.com/flutter/flutter/issues/134452

This patch parses the speed of all CPU data out of /proc and constructs a table that allows us to request high level CPU affinities: performance, efficiency, and not performance. These affinties are applied where appropriate during Android thread construction.
2023-09-19 03:50:05 +00:00
Chris Bracken
0a532593f1 Revert "[Windows] Update vsync on raster thread (#45310)" (flutter/engine#46000)
This also reverts the ANGLE roll (for which the original fix was landed) to 48e2c605adcd5bcc1622b18f357c7a73ebfb3543.

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

This reverts commit 2bec12f0b4d76d9f60d55d057e16cd2788083ade.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-18 22:34:29 +00:00
John McCutchan
c74acc92aa Disable HardwareBuffer backed Platform Views temporarily (flutter/engine#45986)
Necessary to unblock the GPay release
2023-09-18 12:36:16 -07:00
John McCutchan
4081d7d574 Tighten up ImageReaderPlatformViewRenderTarget code (flutter/engine#45889)
- Fix a missing Image close in an error path.
- Ensure we close the Image when the TextureEntry is finalized.
- Fix an inconsistency in the maxImages when running on Android < 33.
- Wrap acquireLatestImage in a try block and return a null image instead
of crashing the application.
2023-09-18 12:34:10 -07:00
LongCatIsLooong
5b716552a7 [iOS] Remove selectionDidChange call in UndoManager (flutter/engine#45657)
Fixes https://github.com/flutter/flutter/issues/133424

The `-[TextInputDelegate selectionDidChange:]` call actually triggers some unwanted keyboard NLP actions that generate a bunch of candidates and automatically accept the first candidate. This causes `-[UITextInput setMarkedText:selection]` to be called with the first candidate and that inserts extraneous characters after the user types certain characters on the iPad software keyboard.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-18 17:18:57 +00:00
Jonah Williams
83f48da122 Revert "[Impeller] construct text frames on UI thread." (flutter/engine#45910)
Reverts flutter/engine#45418

Some google3 tests are hitting the CHECK I added in the DlSkCanvasDispatcher::drawTextFrame, which indicates that the SkParagraph code likely thinks impeller is enabled, whereas other code might be running with Skia.

Perhaps this could happen if its software rendering? It should be a fatal error on startup so we can track this down.
2023-09-16 01:22:13 +00:00
Kevin Lubick
7da278b05b Migrate GrMipmapped->skgpu::Mipmapped (flutter/engine#45881)
Skia's Graphite and Ganesh backend coalesced two enums regarding mipmaps
into one and deprecated the public Ganesh version. This migrates Flutter
to use the preferred type.

No functional changes expected. See also
https://skia-review.googlesource.com/c/skia/+/753567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] 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
2023-09-15 11:48:20 -04:00
XuanTung95
f95e3baebc Reduce unnecessary Dart_TimelineGetMicros call (flutter/engine#45637)
Minor changes that reduce unnecessary Dart_TimelineGetMicros calls.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-14 22:46:56 +00:00