1707 Commits

Author SHA1 Message Date
auto-submit[bot]
b23bc03d6d Reverts "Drop deprecated hash_code functions (#54000)" (flutter/engine#54002)
Reverts: flutter/engine#54000
Initiated by: chingjun
Reason for reverting: Broke Google Testing.

See b/352191023 for more details.
Original PR Author: kevmoo

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/151679
2024-07-19 05:33:47 +00:00
Kevin Moore
fdd23ed3f2 Drop deprecated hash_code functions (flutter/engine#54000)
Fixes https://github.com/flutter/flutter/issues/151679
2024-07-19 02:11:17 +00:00
Matan Lurey
50e4e12c2e Add a "pub workspace" to the root of the engine repository (flutter/engine#53539)
... and use it in `engine_tool` to prove everything is working, i.e. on CI and elsewhere.

Partial work towards https://github.com/flutter/flutter/issues/147883.
Supersedes and closes https://github.com/flutter/engine/pull/51782 (which was a prototype).

See also:
- https://flutter.dev/go/pub-workspace, the design doc on the feature.
- https://github.com/dart-lang/pub-dev/pull/7762, an example PR.

I'll probably end up moving the inline docs in `pubspec.yaml` to a `docs/*.md` once that's a thing.
2024-07-18 16:18:09 +00:00
Yegor
d7c9dafda7 [web] switch to SemanticsAction.focus (attempt 3) (flutter/engine#53689)
This relands https://github.com/flutter/engine/pull/53679.

The difference from the previous attempt is in the last commit, which prevents synthetic focus requests from echoing back into the framework. That part broke too many tests in g3 and needs to be revisited.

## Original description

Stop using `SemanticsAction.didGain/LoseAccessibilityFocus` on the web, start using `SemanticsAction.focus`. This is because on the web, a11y focus is not observable, only input focus is. Sending `SemanticsAction.focus` will guarantee that the framework move focus to the respective widget. There currently is no "unfocus" signal, because it seems to be already covered: either another widget gains focus, or an HTML DOM element outside the Flutter view does, both of which have their respective signals already.

More details in the discussion in the issue https://github.com/flutter/flutter/issues/83809.

Fixes https://github.com/flutter/flutter/issues/83809
Fixes https://github.com/flutter/flutter/issues/148285
Fixes https://github.com/flutter/flutter/issues/143337
2024-07-15 17:12:21 +00:00
Kevin Moore
8c1a2c2c51 Drop self-references to hash functions from doc comments (flutter/engine#53844)
Towards https://github.com/flutter/flutter/issues/151679
2024-07-13 04:33:48 +00:00
Jason Simmons
604637e41f Manual roll Dart SDK from fb546f313557 to 797d3df745d1 (8 revisions) (flutter/engine#53832)
Includes patches needed for the dart:concurrent package (see https://dart.googlesource.com/sdk/+/d2bc055651cf62c549933ed379d6b23d84a07598)

Manual roll requested by jsimmons@google.com

https://dart.googlesource.com/sdk.git/+log/fb546f313557..797d3df745d1

2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-34.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-33.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-32.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-31.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-30.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-29.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-28.0.dev 2024-07-11 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.6.0-27.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 bdero@google.com,dart-vm-team@google.com,jsimmons@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
2024-07-12 01:28:10 +00:00
Jonah Williams
ac871bacc2 [dart:ui] remove expensive index assertion in Vertices. (flutter/engine#53558)
Iterating through every index value is really, really expensive. Especially if users are suppllying hundreds of thousands of vertices.
2024-07-11 22:13:04 +00:00
auto-submit[bot]
5a218a1b99 Reverts "dart:ui - drop deprecated hash functions (#53787)" (flutter/engine#53794)
Reverts: flutter/engine#53787
Initiated by: jiahaog
Reason for reverting: There are still internal users of these hash functions (b/352191023). Flutter also exports it [here](72f83d3237/packages/flutter/lib/src/painting/basic_types.dart (L58)) so its easy for developers to use them even without importing `dart:ui`. Though it's an easy fix, I'd imagine this to be a breaking change for the OSS ecosystem a
Original PR Author: kevmoo

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
These were deprecated a LONG time ago
2024-07-10 03:16:50 +00:00
John McDole
ea09bae632 Impeller really wants premultiplied alpha (flutter/engine#53770)
Fixes flutter/flutter#151210 by premultiplying alpha in the rare case we
get straight alpha.
2024-07-09 17:07:31 -07:00
Kevin Moore
3ac0cca053 dart:ui - drop deprecated hash functions (flutter/engine#53787)
These were deprecated a LONG time ago
2024-07-09 23:50:06 +00:00
Mouad Debbar
5fb88851d5 Add Semantics Property linkUrl (flutter/engine#53507)
The new property allows the user to specify a URI for their semantics link node. It's plumbed through for both web and non-web engines, but it's only used in the web engine currently. It sets the `href` of the anchor element associated with semantics node.

This is going to unlock better semantics support in the Link widget on web ([PR](https://github.com/flutter/packages/pull/6711)).

Framework counterpart: https://github.com/flutter/flutter/pull/150639

Part of https://github.com/flutter/flutter/issues/150263
2024-07-03 21:12:26 +00:00
Jia Hao
1306b98121 Revert "[web] switch from .didGain/LoseAccessibilityFocus to .focus" (flutter/engine#53679)
Reverts flutter/engine#53360

Breaking google3 in b/350131288.

There is a test that does something like the following, to check if a radio button is selected.

```dart
      // Send a bunch of tabs to focus on the correct radio button
      await tester.sendKeyEvent(LogicalKeyboardKey.tab);
      await tester.pump();
      await tester.sendKeyEvent(LogicalKeyboardKey.tab);
      await tester.pump();
      await tester.sendKeyEvent(LogicalKeyboardKey.tab);
      await tester.pump();

      // Toggle the radio button with space
      await tester.sendKeyEvent(LogicalKeyboardKey.space);
      await tester.pump();

      final selectedRadio =
          tester.widget<Radio<bool>>(find.byType(Radio<bool>).at(1));
      expect(selectedRadio.value, isTrue);
```

After this commit, the above test fails. See the linked bug above for more details.
2024-07-02 17:02:06 +00:00
Yegor
c5a8a826ef [web] switch from .didGain/LoseAccessibilityFocus to .focus (flutter/engine#53360)
This is a repeat of https://github.com/flutter/engine/pull/53134, which was merged prematurely.

> [!WARNING]  
> Only land this after:
> * https://github.com/flutter/flutter/pull/149840 lands in the framework.
> * You have personally manually tested the change together with the latest framework on all browsers.

## Original PR description

Stop using `SemanticsAction.didGain/LoseAccessibilityFocus` on the web, start using `SemanticsAction.focus`. This is because on the web, a11y focus is not observable, only input focus is. Sending `SemanticsAction.focus` will guarantee that the framework move focus to the respective widget. There currently is no "unfocus" signal, because it seems to be already covered: either another widget gains focus, or an HTML DOM element outside the Flutter view does, both of which have their respective signals already.

More details in the discussion in the issue https://github.com/flutter/flutter/issues/83809.

Fixes https://github.com/flutter/flutter/issues/83809
Fixes https://github.com/flutter/flutter/issues/148285
Fixes https://github.com/flutter/flutter/issues/143337
2024-06-28 21:35:10 +00:00
Jim Graham
34bb05029e [DisplayList] Switch to recording DrawVertices objects by reference (flutter/engine#53548)
The Vertices objects are already allocated in a shared object by default so copying them inline into the recording buffer is usually a waste of time rather than reusing the memory allocated for the shared object by recording a reference. Note that the shared DlVertices objects already inline all of their data so we have good data locality as it is without further copying the data into the buffer.

Might help with https://github.com/flutter/flutter/issues/150513
2024-06-25 17:41:14 +00:00
Jim Graham
7f44004e56 [DisplayList] delete obsolete PathEffect sources (flutter/engine#53441)
As of https://github.com/flutter/engine/pull/53411 there are no more (non-test) references to path effects anywhere in the engine.

Deleting the dead code.
2024-06-18 07:45:01 +00:00
gaaclarke
41f2a43998 [Impeller] makes bgra10xr test more comprehensive (flutter/engine#53320)
fixes https://github.com/flutter/flutter/issues/149946

depends on:
- https://skia-review.googlesource.com/c/skcms/+/864516
- https://skia-review.googlesource.com/c/skia/+/864536

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-11 22:34:19 +00:00
Tong Mu
48799ceebf Make pointer events ignore invalid views (flutter/engine#51925)
With this PR, Flutter will now ignore pointer events for an invalid view, i.e. views that have not been add or have been removed.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-06 07:18:20 +00:00
David Iglesias
6eacdf2be8 [web] Adds allowPlatformDefault for wheel signals. (flutter/engine#51566)
Adds a function to each 'wheel' DataPacket sent to the framework so it can signal whether to `allowPlatformDefault` or not.

The current default is to always `preventDefault` on browser events that get sent to the framework.

This PR enables the framework to call a method on the `DataPacket`s to `allowPlatformDefault: true`, if the framework won't handle the Signal (signals are handled synchronously on the framework).

This lets the engine "wait" for the framework to decide whether to `preventDefault` on a `wheel` event or not.

## Issues

* Needed for: https://github.com/flutter/flutter/issues/139263

## Tests

* Added unit tests for the feature in the engine repo, veryfing whether the event has had its `defaultPrevented` or not.
* Manually tested in a demo app (see below)

## Demo

* https://dit-multiview-scroll.web.app

<details>
<summary>

## Previous approaches

</summary>

1. Add a `handled` bool property to `PointerDataPacket` that the framework can write to (brittle)
2. Modifications to the `PlatformDispatcher` so the framework can `acknowledgePointerData` with a `PointerDataResponse` (fffffatttt change)
3. `acknowledge` function in `PointerDataPacket`

</details>

> [!IMPORTANT]
> * Related: https://github.com/flutter/flutter/pull/145500

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-05 23:25:53 +00:00
gaaclarke
2dc427b86f [Impeller] added test for bgra10xr png encoding (flutter/engine#53182)
fixes: https://github.com/flutter/flutter/issues/148851
depends on: 
 - https://skia-review.googlesource.com/c/skcms/+/861638
 - https://skia-review.googlesource.com/c/skia/+/861516

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-06-05 14:41:05 -07:00
Matan Lurey
2565803818 Re-land #52859: Revamp the engine style guide, remove always_specify_types (flutter/engine#53223)
Based on the (internal) discussion around converging on using the official Dart style guide, the design discussion https://flutter.dev/go/use-dart-style-in-flutter-engine, and with the exception of the code that gets published under `dart:ui` (as that is user-facing, and we'd like to evolve the code style in conjunction with the framework), we're going to be (gradually) adopting the Dart style guide in `flutter/engine`.

For now, we:
- Remove `always_specify_types` (except for `lib/ui`, i.e. `dart:ui`)
- Re-enable `type_annotate_public_apis` (which is now relevant since the above is disabled)
- Announce our _intent_ to re-format and apply the Dart formatter (which we'll land in the near future)

---

I also took the opportunity to specify more about our style guide use in general, mostly to make it easier to understand our conventions, and also call out known problem areas (notably, our over-use of `shared_ptr` and `auto` in some cases). I am happy to split those up, but it was easier to make the markdown changes at once.

I also took @cbracken and folks advice and clarified directly that explicit types in Dart are _not_ bad (with examples).
2024-06-05 16:53:06 +00:00
victorgalo
2b309db996 Add support for setting the heading level for web semantics (#97894) (flutter/engine#41435)
This change adds a new property in Semantics widget that would take an integer value corresponding to the heading levels defined by the ARIA heading role. This is necessary in order to get proper accessibility and usability in a website for users who rely on screen readers and other assistive technologies.

Issue fixed by this PR:
https://github.com/flutter/flutter/issues/97894

Framework part:
https://github.com/flutter/flutter/pull/125771
2024-06-04 23:11:17 +00:00
Jonah Williams
d012531b02 [Impeller] fix NPE caused by implicit sk_sp to fml::Status conversion. (flutter/engine#53177)
nullptr is converted to fml::Status::OK(nullptr), which we don't null check. Change this to consistently use fml::Status

Discovered in https://github.com/flutter/flutter/issues/148851
2024-06-03 20:43:07 +00:00
Yegor
17f50b3a8a [semantics] fix dartdoc grammar (flutter/engine#53121)
Courtesy of @gspencergoog: "which widget" is korrecter than "what widget".
2024-05-30 22:22:19 +00:00
Yegor
d3b6b1be14 add SemanticsAction.focus (flutter/engine#53094)
Add `SemanticsAction.focus`. This PR just adds the new enum value without any logic. Adding the enum value first to unblock work that needs to be done on both the engine and framework side that will actually implement all the necessary logic.

This is PR 1 out of ~3 for https://github.com/flutter/flutter/issues/83809
2024-05-30 17:15:53 +00:00
Jonah Williams
0847b349a7 [Impeller] revert changes to IO thread upload scheduling. (flutter/engine#53096)
Fixes https://github.com/flutter/flutter/issues/147429

Turns out we need the I/O thread for all backends still to limit uploads otherwise we compete with the raster thread.
2024-05-29 20:59:16 +00:00
Michael Goderbauer
c7f659ac91 Switch to FilterQuality.medium for images (flutter/engine#52984)
https://github.com/flutter/flutter/issues/148253
2024-05-29 20:02:17 +00:00
LongCatIsLooong
35ca2dd175 Allow unsetting TextStyle.height (flutter/engine#52940)
Introduces a sentinel value `kTextHeightNone` for `ui.TextStyle.height` which can be used to "unset" the current `TextStyle.height` (and for consistency, it applies to `StructStyle.height` and `ParagraphStyle.height` too). Documentation of `TextStyle.height` can be found [here](https://main-api.flutter.dev/flutter/painting/TextStyle/height.html) (the one from `painting` library not `dart:ui`).
 
part of https://github.com/flutter/flutter/issues/58765: currently `TextStyle.height` uses `null` as the sentinel value for "no height multiplier specified, use the font height", which has conflicting semantics: it means the height multiplier is not set (so the span height is determined by font metrics) but in reality it also means the height should inherit from its parent span (or in `copyWith` context, it means do not override the height).

The new sentinel value `kTextHeightNone` is currently set to `0.0`. This is because skparagraph internally uses 0 for "no height multiplier", so using 0 should minimize the behavior change: 
62f369c759/modules/skparagraph/src/Run.cpp (L65-L67)

This MAY still change the current behavior: for consistency setting `StructStyle.height` / `ParagraphStyle.height` to the sentinel value also unsets the height multiplier which may not be the current behavior.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-24 00:16:16 +00:00
auto-submit[bot]
ea811b97ba Reverts "Manual roll of Clang from 725656bdd885 to 145176dc0c93 (#52823)" (flutter/engine#52890)
Reverts: flutter/engine#52823
Initiated by: zanderso
Reason for reverting: Engine crashes on framework CI following this roll https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20flutter_gallery__transition_perf_with_semantics/12126/overview
Original PR Author: jason-simmons

Reviewed By: {zanderso}

This change reverts the following previous change:
See https://github.com/flutter/flutter/issues/143178
2024-05-16 22:01:38 +00:00
Jason Simmons
31d7cb2870 Manual roll of Clang from 725656bdd885 to 145176dc0c93 (flutter/engine#52823)
See https://github.com/flutter/flutter/issues/143178
2024-05-16 17:16:21 +00:00
auto-submit[bot]
d810c59879 Reverts "Revamp the engine style guide, remove always_specify_types. (#52859)" (flutter/engine#52867)
Reverts: flutter/engine#52859
Initiated by: zanderso
Reason for reverting: This sort of change *is* in scope for a discussion at the Dash forum.
Original PR Author: matanlurey

Reviewed By: {cbracken, gaaclarke, johnmccutchan}

This change reverts the following previous change:
Based on the (internal) discussion around converging on using the official Dart style guide, with the exception of the code that gets published under `dart:ui`, as that is user-facing, and we'd like to evolve the code style in conjunction with the framework.

I also took the opportunity to specify more about our style guide use in general, mostly to make it easier to understand our conventions, and also call out known problem areas (notably, our over-use of `shared_ptr` and `auto` in some cases). I am happy to split those up, but it was easier to make the markdown changes at once.

I also took @cbracken and folks advice and clarified directly that explicit types in Dart are _not_ bad (with examples).
2024-05-16 02:51:50 +00:00
Matan Lurey
706817bd67 Revamp the engine style guide, remove always_specify_types. (flutter/engine#52859)
Based on the (internal) discussion around converging on using the official Dart style guide, with the exception of the code that gets published under `dart:ui`, as that is user-facing, and we'd like to evolve the code style in conjunction with the framework.

I also took the opportunity to specify more about our style guide use in general, mostly to make it easier to understand our conventions, and also call out known problem areas (notably, our over-use of `shared_ptr` and `auto` in some cases). I am happy to split those up, but it was easier to make the markdown changes at once.

I also took @cbracken and folks advice and clarified directly that explicit types in Dart are _not_ bad (with examples).
2024-05-16 01:07:17 +00:00
Chinmay Garde
f20b17a2ae [Impeller] Prepare a SkiaGPU-less iOS build. (flutter/engine#52748)
The size of the LTO build of the engine with the dylib compressed is as follows:

```sh
$ du -k libFlutter*
5236	libFlutter.dylib.tar.gz
4324	libFlutterSlimpeller.dylib.tar.gz
```

Sizes are in KiB. This represents a binary size reduction of 17.41% of the compressed artifacts. The compression ratios will likely differ based on the compression scheme.

Uncompressed, the sizes are:

```sh
$ du -k libFlutter*
16920	libFlutter.dylib
14044	libFlutterSlimpeller.dylib
```

This represents a binary size reduction of 16.99% which is in the same ballpark.

The really mucky bit was backing out the raster cache and persistent cache. I want to clean that up in a later patch so that those TUs are part of a separate submodule.

Opting out of Impeller will lead to a fatal log at startup saying the opt-out is disallowed.

Fixes https://github.com/flutter/flutter/issues/126606
2024-05-13 21:43:47 +00:00
Zachary Anderson
9d6bf0d3b0 Revert "Various documentation improvements (#52600)" (flutter/engine#52709)
Reverts flutter/engine#52623

Reason for revert is noted on the PR.
2024-05-10 07:54:51 -07:00
Ian Hickson
f0f469735d Various documentation improvements (#52600) (flutter/engine#52623)
This is a reland of https://github.com/flutter/engine/pull/52600 which
was reverted in https://github.com/flutter/engine/pull/52607 due to a
typo.
2024-05-09 15:33:52 -07:00
Jonah Williams
d790b88806 [Impeller] Support copy from buffer to texture for GLES blitpass, use blit pass to set contents in glyph atlas. (flutter/engine#52510)
part of https://github.com/flutter/flutter/issues/138798

Works around https://github.com/flutter/flutter/issues/144498 for the glyph atlas.

Adds BlitPass::AddCopy implementation for GLES, which is mostly a copy of Texture::SetContents. Updates the glyph atlas to use a blit pass and device private textures instead of set contents (which is unsafely on Metal).

This also removes DeviceBuffer::AsTexture, which isn't actually used anywhere - and creates a linear texture on iOS (and fails with an unsupported API on simulators).

Note that in general, we don't actually have support for hostVisible textures on GLES _or_ Vulkan. Instead, VMA is falling back to device private textures. We may want to, separately, remove the concept of host visible from textures - and similarly remove the concept of transient from buffers.
2024-05-08 00:02:22 +00:00
auto-submit[bot]
9c144b5c05 Reverts "Various documentation improvements (#52600)" (flutter/engine#52607)
Reverts: flutter/engine#52600
Initiated by: zanderso
Reason for reverting: Failing to roll to the framework on a snippet analysis failure: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8748612253464522177/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout
Original PR Author: Hixie

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
No description provided.
2024-05-07 14:09:47 +00:00
Ian Hickson
a6ad5a09b2 Various documentation improvements (flutter/engine#52600) 2024-05-07 06:59:54 +00:00
Alexander Aprelev
8bd9e60267 Use new Dart_PortEx api to ensure SendPort can be rebuild properly. (flutter/engine#52498)
Currently used Dart API can not be reliably used to rebuild dart
SendPort object, [new API was introduced in dart sdk
](https://dart.googlesource.com/sdk/+/de4029ee1ba3bc89d839ae7d2fd0706d29abae58)
and this PR moves flutter engine to use that new API.

BUG: https://github.com/flutter/flutter/issues/147469
2024-05-02 09:06:38 -07:00
Ian Hickson
8966c48831 Remove rasterizerTracingThreshold, checkerboardRasterCacheImages, and checkerboardOffscreenLayers, etc (flutter/engine#52446) 2024-05-02 04:35:04 +00:00
gaaclarke
4429b2f2fe [Impeller] Implements retry for Picture.toImage (flutter/engine#52470)
fixes https://github.com/flutter/flutter/issues/146990

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-05-01 08:53:54 -07:00
Jonah Williams
8f21d27541 [Impeller] fix GLES image upload. (flutter/engine#52430)
TLDR: this was a load bearing closure.

See https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20complex_layout_scroll_perf_impeller_gles__timeline_summary/1492/overview
2024-04-29 14:24:21 +00:00
Jonah Williams
584a0394aa [Impeller] remove image upload from IO thread, limit concurrent worker threads. (flutter/engine#52423)
Fixes https://github.com/flutter/flutter/issues/123058
Fixes https://github.com/flutter/flutter/issues/135443

We're currently using the IO thread to bottleneck image uploads. Instead, just use fewer concurrent worker threads - and cap the limit at something small. For a Pixel device, this should use about 2 threads maximum, instead of  5 (4 worker and 1 IO).
2024-04-28 17:22:15 +00:00
Tong Mu
94448fc97f Move PointerDataPacketConverter from PlatformView to RuntimeController (flutter/engine#51952)
This is a refactor that moves the `PointerDataPacketConverter` from `PlatformView` to `RuntimeController`. 

This change is made for the following reasons:
- Currently, the pointer data conversion contains no platform specific logic (because the current converter's only responsibility is to make the event sequence conform Flutter's protocol). Therefore these logics should reside in a platform-independent place.
- The converter typically converts one event to many. It's better to have this conversion later than earlier.
- It removes a member from `PlatformView`, making it closer to a pure virtual class.

The reason to choose `RuntimeController` as the destination is because `RuntimeController` manages a map for views, which is required for the converter to implement a later patch https://github.com/flutter/engine/pull/51925.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-26 23:45:21 +00:00
Jonah Williams
5935f48862 [Impeller] while we still have benchmarks, see if we're efficient enough for this to be faster. (flutter/engine#52398)
We don't need to decode images to a malloc'd buffer, but this benchmarked as faster because we did so much allocation during the frame. Maybe this is better now? Lets run the benchmarks
2024-04-25 21:12:10 +00:00
Jonah Williams
9dbe934a9b [Impeller] kick off registration and initial PSO compilation of runtime effect earlier. (flutter/engine#52381)
I thought about changing this API so that it blocks on compilation, but I think that isn't necesasary as the workload can happen while the UI thread is building. Plus, even blocking on shader completion does not guarantee that we won't need to compile a variant anyway.

While I was at it I moved the descriptor sets computation to the runtime effect constructor.

With this change the pipleine variant used during the frame is produced much faster than the initial 12ms compilation.

![image](https://github.com/flutter/engine/assets/8975114/42626676-0a71-4503-a3e9-4109c36fbbef)

Fixes https://github.com/flutter/flutter/issues/113719
Fixes https://github.com/flutter/flutter/issues/141222
2024-04-25 20:23:56 +00:00
Ian Hickson
b7117adf38 Document the new binding hooks for SceneBuilder, PictureRecorder, Canvas (flutter/engine#52374)
See https://github.com/flutter/flutter/pull/147271 for context.

Do not land until https://github.com/flutter/flutter/pull/147271 has landed.
2024-04-25 03:05:20 +00:00
hellohuanlin
cabd4fcacd [ios_edit_menu]add native edit menu (flutter/engine#50095)
Support native edit menu on the engine side. 

Design doc: https://docs.google.com/document/d/16-8kn58h_oD902e7vPSh6W20aHRBJKyNOdSe5rbAe_g/edit?resourcekey=0-gVdJ3fbOybV70ZKeHU7fkQ&tab=t.0

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

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

*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-04-22 23:36:18 +00:00
PurplePolyhedron
2ae24d260d Fix link in BlendMode.saturation (flutter/engine#52156)
Fix typo in the document of `BlendMode.saturation`. It has a link to image https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_hue.png, while it should be `blend_mode_saturation.png`

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-22 17:48:26 +00:00
Michael Goderbauer
9d5b33fff8 Fix docs for SemanticsAction (flutter/engine#52229)
The old rendering:

![image](https://github.com/flutter/engine/assets/1227763/201c1bed-b27b-40de-8abf-0c091fb20d3f)

This changes uses markdown syntax introduced in 5fab3a7bc8

Fixes https://github.com/flutter/flutter/issues/94494.
2024-04-18 18:32:03 +00:00
Jason Simmons
50771f3ad4 Roll reclient, libpng, and zlib (flutter/engine#52072)
Based on https://github.com/flutter/engine/pull/52067
2024-04-16 18:31:30 +00:00