3239 Commits

Author SHA1 Message Date
Matan Lurey
63d44d17dc Surgically remove .*dither.* from the Engine (flutter/engine#46750)
Closes https://github.com/flutter/flutter/issues/112498.

We no longer support any user-visible configuration around dithering. It is unconditionally applied for gradients (in both the Skia and Impeller backends), and never applied elsewhere. After this change, I'll update https://docs.flutter.dev/release/breaking-changes/paint-enableDithering accordingly.

---

~~Requires https://github.com/flutter/engine/pull/46746 to land successfully~~ Done.

Alright, this appears ready to review!
2023-10-31 22:28:00 +00:00
Jackson Gardner
d6ca6b37d2 Move flutter.js into the engine. (flutter/engine#47240)
This will allow us to add tooling to do some bundling/minifying of `flutter.js`, which should make this more scalable/extensible long-term.

Also, this removes a few redundant build rules that produce artifacts that the flutter tool doesn't use anymore.
2023-10-31 19:19:17 +00:00
Kate Lovett
285a6acf76 Bump goldctl (flutter/engine#47391)
Related to https://github.com/flutter/flutter/issues/137177

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-31 16:45:14 +00:00
Jonah Williams
b4efc3450e Revert "[Impeller] remove image upload workarounds." (flutter/engine#47402)
Reverts flutter/engine#47209

This actually did regress things, I benchmarked poorly!

see https://flutter-flutter-perf.skia.org/e/?queries=device_type%3DPixel_7_Pro%26sub_result%3D90th_percentile_frame_rasterizer_time_millis%26sub_result%3D99th_percentile_frame_rasterizer_time_millis%26sub_result%3Daverage_frame_rasterizer_time_millis%26sub_result%3Dworst_frame_rasterizer_time_millis%26test%3Dnew_gallery_impeller__transition_perf

I did check https://developer.arm.com/documentation/101897/0301/CPU-overheads/Vulkan-CPU-memory-mapping and we're following the expected advice there. Without a much deeper investigation though we may not have any idea what to do
2023-10-30 17:34:15 +00:00
Mouad Debbar
57cc7e9136 [web] DomManager for each FlutterView (flutter/engine#47388)
The PR may seem large, but the main changes are simple:

- Introduce a `DomManager` that aims to take over all DOM responsibilities from `FlutterViewEmbedder`.
- Update all references to `flutterViewEmbedder.*domElement*` to `domManager.*domElement*`.
- Describe the general DOM structure of a Flutter View in a doc comment.

Next steps (in future PRs):
- Move all DOM manipulation methods out of `FlutterViewEmbedder` into `DomManager`.
- Move DOM creation logic out of `FlutterViewEmbedder` into `DomManager`.
2023-10-27 23:53:27 +00:00
Zachary Anderson
e1fc52e2b6 Move rapidjson to flutter/third_party (flutter/engine#47354)
As part of eliminating the Flutter buildroot
(https://github.com/flutter/flutter/issues/67373), we are moving all
third-party dependencies from //third_party to //flutter/third_party.

Once all third-party dependencies have been migrated, tooling and config
will be moved and the buildroot will be eliminated altogether.

No tests changed because there is no semantic change to this PR. This is
simply relocating a dependency.
2023-10-27 08:00:56 -07:00
Tong Mu
a98c3dc263 Skip invalid renders in Dart (flutter/engine#47323)
With this PR, invalid renders are skipped in Dart in both release build and debug build.

Part of https://github.com/flutter/flutter/issues/137073 and part of relanding https://github.com/flutter/engine/pull/45555.

Unit tests will be relanded in a following PR once this PR is confirmed performance-safe.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-26 22:09:10 +00:00
gaaclarke
5bfb2200b0 Migrated away from UnmodifiableUint8ListView (flutter/engine#47276)
## 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-10-24 14:08:45 -07:00
Harry Terkelsen
84e466b785 Reland "Use a single OffscreenCanvas for rendering in CanvasKit (#45744)" (flutter/engine#47241)
Using a single GL context avoids several issues with managing GL context
lifecycle.

## 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-10-24 13:21:58 -07:00
Tong Mu
87171e7339 Reland 2: Multiview Pipeline (flutter/engine#47239)
The last attempt https://github.com/flutter/engine/pull/47234 was reverted because there was another test merged in the meantime that violates the rule added in this PR.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-23 23:46:25 +00:00
Zachary Anderson
d549483298 Revert "Reland: Multiview pipeline " (flutter/engine#47237)
Reverts flutter/engine#47234

Failures like
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20Production%20Engine%20Drone/186568/overview
making the tree red.
2023-10-23 15:17:36 -07:00
Tong Mu
9ed503a734 Reland: Multiview pipeline (flutter/engine#47234)
This PR relands https://github.com/flutter/engine/pull/44473.

The previous PR was immediately reverted after merging because we found that the PR could cause illegal renders to be skipped on debug builds but crash the app on release builds. This PR makes the `Animator::Render` skip illegal renders as well. This should not be the final shape of this feature, and thus a TODO is added.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-23 21:35:04 +00:00
Nate Bosch
fbb4b6abd9 Update to the latest package:test (flutter/engine#46592)
- Update the pinned version of `test` to the latest published.
- Add support for reading the `source.location` of messages to the JS
  interop library.
- Update `host.dart` to support the new communication pattern with the
  test frame. See https://github.com/dart-lang/test/issues/2065
- Use `Runtime.edge` for the edge browser. We may deprecate or remove
  the constant. Edge is a more appropriate value for this usage.
2023-10-23 19:08:10 +00:00
Jonah Williams
fd07a6783b [Impeller] remove image upload workarounds. (flutter/engine#47209)
Testing locally I cant see any impact from this. Its possible the problem this "fixed" was instead fixed by affinity changes and now its no longer necessary.

See https://github.com/flutter/engine/pull/43493 .
2023-10-23 18:53:56 +00:00
auto-submit[bot]
47c3403c39 Reverts "Multiview pipeline" (flutter/engine#47174)
Reverts flutter/engine#44473
Initiated by: dkwingsmt
This change reverts the following previous change:
Original Description:
This PR makes `Animator` able to handle multiple views, and updates unit tests accordingly.

Before:
<img width="543" alt="image" src="https://github.com/flutter/engine/assets/1596656/f7d0e0e4-cc85-4a6e-b516-1896ac3c1b35">

After:
<img width="614" alt="image" src="https://github.com/flutter/engine/assets/1596656/68106301-66ef-4cd1-aeaf-d9c6127ccec2">

Now `Animator::Render` must be called during `Animator::BeginFrame`, which is split into `BeginFrame` and `EndFrame`. This requirement is made possible by https://github.com/flutter/engine/pull/45555. The reason to split is to allow `ShellTest::PumpOneFrame` to insert a render from C++ code.

`ShellTest::PumpOneFrame` is also refactored to allow pumping a frame without any views.

A few unit tests are tweaked to resolve racing condition.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-20 20:57:08 +00:00
Tong Mu
1cfde62821 Multiview pipeline (flutter/engine#44473)
This PR makes `Animator` able to handle multiple views, and updates unit tests accordingly.

Before:
<img width="543" alt="image" src="https://github.com/flutter/engine/assets/1596656/f7d0e0e4-cc85-4a6e-b516-1896ac3c1b35">

After:
<img width="614" alt="image" src="https://github.com/flutter/engine/assets/1596656/68106301-66ef-4cd1-aeaf-d9c6127ccec2">

Now `Animator::Render` must be called during `Animator::BeginFrame`, which is split into `BeginFrame` and `EndFrame`. This requirement is made possible by https://github.com/flutter/engine/pull/45555. The reason to split is to allow `ShellTest::PumpOneFrame` to insert a render from C++ code.

`ShellTest::PumpOneFrame` is also refactored to allow pumping a frame without any views.

A few unit tests are tweaked to resolve racing condition.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-20 20:38:23 +00:00
Mouad Debbar
e55aecc152 [web] Remove workaround for safely removing slots on Safari (flutter/engine#47169)
Now that we want to support multi-view, we need to either:
1. Remove the workaround to safely remove slot elements in Safari, or
2. Fix it to support multi-view (can't use `flutterViewEmbedder.glassPaneShadow` anymore).

According to [this comment](https://github.com/flutter/flutter/issues/85816#issuecomment-1122638147), this is the right time to remove the workaround 😄 I tested on Desktop Safari and iOS Safari and wasn't able to reproduce the crash reported in https://github.com/flutter/flutter/issues/84832.

Fixes https://github.com/flutter/flutter/issues/85816
Part of https://github.com/flutter/flutter/issues/134443
2023-10-20 19:51:22 +00:00
chunhtai
bcbf0887b9 Add link support in web accessibility (flutter/engine#46117)
fixes https://github.com/flutter/flutter/issues/134795

## 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-10-20 12:20:08 -07:00
Mouad Debbar
92eac4f833 [web] Support flutterViewId in platform view messages (flutter/engine#46891)
- Accept a new `flutterViewId` field in platform view messages.
- Keep transitory support for legacy platform view messages that don't contain `flutterViewId`.
- Default view factories set `width:100%` and `height:100%`.
2023-10-20 19:17:36 +00:00
Jackson Gardner
38b42c9f14 Fix async image loading issues in skwasm. (flutter/engine#47117)
This fixes https://github.com/flutter/flutter/issues/134045

There were a few different issues here:
* We need to do our own message passing for rendering pictures. The async methods provided by emscripten have their own queue that can drain synchronously, so basically it's not guaranteed to be FIFO with other messages sent to the web worker or main thread.
* When we drop frames, we should only drop intermediate frames, so that when the rendering flurry stops that the frame that is displayed is the last one that was actually requested.
* We need to reset the GL context after lazy image creation, otherwise skia's renderer gets into a bad state for that frame.
2023-10-20 18:30:33 +00:00
Mouad Debbar
b743fa9f2e [web] Make HotRestartCacheHandler standalone (flutter/engine#46906)
- `EmbeddingStrategy` shouldn't own the creation of `HotRestartCacheHandler`.
- Simplify `HotRestartCacheHandler`'s JS-interop by using a `JSArray` directly instead of going through a Dart `List`.
2023-10-20 16:05:14 +00:00
Mouad Debbar
d11e7434ff [web] Attach pointer event listeners in the bubble phase (flutter/engine#47121)
There's no reason (that we know of) to listen to pointer events during the capture phase, so let's listen on the bubble phase.

I couldn't find a reason for listening to pointer events during the capture phase. So let's listen on the bubble phase which is more natural and allows platform views to `stopPropagation` in order to prevent Flutter from receiving an event.
2023-10-20 16:03:15 +00:00
Tong Mu
dfc7b21ade Reland 2 (part 2): Enforce the rule of calling FlutterView.Render (flutter/engine#47095)
This PR relands part of https://github.com/flutter/engine/pull/45300, which was reverted in https://github.com/flutter/engine/pull/46919 due to performance regression.

Due to how little and trivial production code the original PR touches, I really couldn't figure out the exact line that caused it except through experimentation, which requires changes to be officially landed on the main branch. After this PR lands, I'll immediately fire a performance test.

This PR contains the render rule check performed by `PlatformDispatcher` of the original PR, the remaining changes to production code besides [the part 1](https://github.com/flutter/engine/pull/47062). Since part 1 shows no regression, the changes of this PR is highly likely to be the culprit. Therefore I made some changes: The rule enforcement is no longer performed in release mode, but only in debug mode. This will cause behavior deviation between builds, but since the developer should be able to notice violation in debug mode anyway, I think this design is acceptable.

It is intentional to not contain any unit tests or other changes of the original PR. They will be landed shortly after this PR.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-19 21:31:14 +00:00
Chris Yang
e559ceb0ac [iOS] Load additional Cupertino system fonts (flutter/engine#46857)
Manually loads darwin system fonts. Darwin system fonts returns different typeface in different sizes. This PR loads the font in different sizes then register them as different fonts. These new fonts can be access through the framework.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-19 17:52:31 +00:00
Jim Graham
5bcbd59138 Revert "[web] Ensure handled key event is not propagated to IME" (flutter/engine#47086)
Reverts flutter/engine#46829

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

Speculative fix for The builds breaking on the web text tests as seen
here: https://github.com/flutter/flutter/runs/17840697842
2023-10-19 09:40:27 +03:00
Matej Knopp
688a695f2b [web] Ensure handled key event is not propagated to IME (flutter/engine#46829)
Fixes [136460](https://github.com/flutter/flutter/issues/136460)

Changes:
- Raw keyboard event is handled during capture phase. This is to ensure
that the framework processes the event before reaching to IME text area
and raw keyboard can stop the propagation for handled events.
- `RawKeyboard` event handler is invoked from `KeyboardBinding` event
handler. This is to prevent race condition because both handlers now run
in capture phase and `KeyboardBinding` needs to process the event first.

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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-10-19 00:52:53 +03:00
Victoria Ashworth
ebe2cf39ca Only run web mac tests on macOS 12 (flutter/engine#46965)
Web Mac tests currently fail on macOS 13 (https://github.com/flutter/flutter/issues/136274, https://github.com/flutter/flutter/issues/136279) so we limit CI to only run on macOS 12.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-17 14:59:05 +00:00
gaaclarke
c8aa0844f2 [Impeller] implements a retry mechanism for dart:ui/Image.toByteData. (flutter/engine#46840)
Design doc: [link](https://docs.google.com/document/d/1Uuiw3pdQxNFTA8OQuZ-kuvYg1NB42XgccQCZeqr4oII/edit#heading=h.hn6wreyrz6fm)
fixes: https://github.com/flutter/flutter/issues/135245

One slight deviation from the design doc is that I decided to make ContextMTL respond to changes to the SyncSwitch instead of having it observe the app state directly.  The benefits are:
1) This keeps that functionality in one location
1) It makes writing tests much easier
1) There's no need of conditional compilation between macos and ios
1) There is no need to add an objc class

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-16 18:31:13 +00:00
Tong Mu
f263e6a49f Revert "Reland: Enforce the rule of calling FlutterView.Render (#45300)" (flutter/engine#46919)
Reverts flutter/engine#45555 due to possible performance regression, b/304898239
2023-10-16 05:37:20 +00:00
skia-flutter-autoroll
b5701a2d66 Manual roll Dart SDK from c8143a7c026f to 5844b34768ce (1 revision) (flutter/engine#46909)
Manual roll requested by jacksongardner@google.com

https://dart.googlesource.com/sdk.git/+log/c8143a7c026f..5844b34768ce

2023-10-13 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-25.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 dart-vm-team@google.com,jacksongardner@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
2023-10-13 21:36:36 +00:00
Erik German
cc53445e19 fixed AutofillHints.middleName tanslation for web. (flutter/engine#46429)
This PR fixes the AutofillHints.middleName has no effect on TextField in Web bug.

<img width="1440" alt="Screenshot 2023-09-30 at 1 18 03 p m" src="https://github.com/flutter/engine/assets/36830415/f6643b71-3944-42da-a9b4-47e1cebb290e">

Closes [#135542](https://github.com/flutter/flutter/issues/135542)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-13 16:34:57 +00:00
gaaclarke
c053bc814b [Impeller] Started throwing errors if dart:ui/Image.toByteData fails (flutter/engine#46738)
issue: https://github.com/flutter/flutter/issues/135245

This is a first step.  Next we'll implement a retry.

## 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-10-13 09:04:47 -07:00
Zachary Anderson
7922a335e8 Don't use objcopy to embed Android icudtl (flutter/engine#46862)
When objcopy is used to embed data into a linkable object file, that
object file will only have default bits set in its header for ABI etc..
If the linker doesn't cooperate by ignoring ABI mismatches on object
files without code, then linking will fail. This PR stops using objcopy
to create an object file that embeds icudtl.dat into the Android
embedder, and instead uses the `bin_to_assembly.py` script that we're
already using for Dart VM snapshot data.

Context in https://github.com/llvm/llvm-project/issues/68915
2023-10-13 07:33:24 -07:00
Mouad Debbar
5c9deddce2 [web] Stop using flutterViewEmbedder for platform views (flutter/engine#46046)
As of right now, there is an indirect link between `flutter/platform_views` messages and `flutterViewEmbedder`, expressed by the callback that's being passed to the `PlatformViewMessageHandler`.

This PR proposed making this relationship clear between `flutter/platform_views` and `implicitView` (i.e. the singleton `window`).

This PR also opens the path for each view to have its own `PlatformViewMessageHandler` instance.

Depends on https://github.com/flutter/engine/pull/46044

Part of https://github.com/flutter/flutter/issues/134443
2023-10-12 21:05:41 +00:00
Dan Field
1e318d57d4 [Impeller] flutter_tester --enable-impeller (flutter/engine#46389)
This patch does the following:

- Updates `flutter_tester` to set up an Impeller rendering context and surface if `--enable-impeller` is set to true, using the Vulkan backend with Swiftshader.
- Updates `run_tests.py` to run all tests except the smoke test (that one really has no rendering impact whatsoever) with and without `--enable-impeller`.
- Updates a few tests to work that were trivial:
  - A couple tests needed updated goldens for very minor rendering differences. Filed https://github.com/flutter/flutter/issues/135684 to track using Skia gold for this instead.
  - Disabled SKP screenshotting if Impeller is enabled, and updated the test checking that to verify an error is thrown if an SKP is requested.
  - The Dart GPU based test now asserts that the gpu context is available if Impeller is enabled, and does not deadlock if run in a single threaded mode.
  - We were missing some trace events around `Canvas::SaveLayer` for Impeller as compared to Skia.
  - A couple other tests had strict checks about exception messages that are slightly different between Skia and Impeller.
- I've filed bugs for other tests that may require a little more work, and skipped them for now. For FragmentProgram on Vulkan I reused an existing bug.

This is part of my attempt to address https://github.com/flutter/flutter/issues/135693, although @chinmaygarde and I had slightly different ideas about how to do this.

The goals here are:

- Run the Dart unit tests we already have with Impeller enabled.
- Enable running more of the framework tests (including gold tests) with Impeller enabled.
- Run all of these tests via public `dart:ui` API rather than mucking around in C++ internals in the engine.
2023-10-11 21:42:24 +00:00
Jackson Gardner
99de03845c Switch to Chrome For Testing instead of Chromium (flutter/engine#46683)
This switches over to using Chrome for Testing instead of Chromium. This requires some changes from the recipes repo (https://flutter-review.googlesource.com/c/recipes/+/51482) in order to coordinate the change in filestructure on the mac versions.
2023-10-11 21:24:11 +00:00
Daniel Chevalier
94df47fedc [web] Adds Noto Music fallback font (flutter/engine#46720)
Adds `Noto Music` font as a fallback font, and updates DEPS and font definitions after running the font roller script.

### Issues

Fixes: https://github.com/flutter/devtools/issues/6149

----

![](https://media.giphy.com/media/3ohzAv6kdQ4tukSNK8/giphy-downsized.gif)

I used [the developer API](https://developers.google.com/fonts/docs/developer_api?apix_params=%7B%22family%22%3A%5B%22Noto%20Music%22%5D%7D) to make sure the api works with this font.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-11 20:46:16 +00:00
Zachary Anderson
0a20e6f0f6 Roll goldctl forward (flutter/engine#46771)
For https://github.com/flutter/flutter/issues/135620
2023-10-11 16:10:05 +00:00
Matan Lurey
2b54d1a9e6 Remove support for Paint.enableDithering=false in dart:ui. (flutter/engine#46745)
Work towards https://github.com/flutter/flutter/issues/112498.

No behavioral changes to existing code, except `Paint.enableDithering = false` will no longer be an option.
2023-10-11 01:24:16 +00:00
Jackson Gardner
2c58573690 Use dart:_wasm constructs to avoid dependence on WebAssembly.Function (flutter/engine#46388)
Use the newly exposed functionality in `dart:_wasm` to fix up two different hacks we have:
1) When creating an image from an image source, use `wasm:import` instead of `@Native` and pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay).
2) When binding the surface callback, previously we were wrapping the callback in a JS function, and then using `WebAssembly.Function` to create a wasm function wrapper around that. Now, we can create a `WasmFuncRef` that is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome.

This fixes https://github.com/flutter/flutter/issues/134556
2023-09-29 20:52:36 +00:00
dependabot[bot]
4c923ebadc Bump webdriver from 3.0.2 to 3.0.3 in /lib/web_ui (flutter/engine#46400)
Bumps [webdriver](https://github.com/google/webdriver.dart) from 3.0.2 to 3.0.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/google/webdriver.dart/blob/master/CHANGELOG.md">webdriver's changelog</a>.</em></p>
<blockquote>
<h2>3.0.3</h2>
<ul>
<li>Include a content-type header when sending requests from <code>async_html.dart</code>.
The content-type is necessary for compatibility with GeckoDriver 0.27.0 and
newer versions.  The content-type header was already being sent in IO clients
for a long time, so only the HTML client had to be updated.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/google/webdriver.dart/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webdriver&package-manager=pub&previous-version=3.0.2&new-version=3.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
2023-09-29 10:05:05 +00:00
Harry Terkelsen
940ac25772 [canvaskit] Do not double-apply ImageFilter transform to children (flutter/engine#46336)
Fixes an issue seen in the "widgets.image_filter_matrix" golden here:
https://flutter-gold.skia.org/search?crs=github&issue=135249&patchsets=3

## 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:12:19 -07:00
Jonah Williams
68175db388 [Impeller] Match Skia gradient clamping behavior (and document). (flutter/engine#44825)
Skia clamps any gradient stops to values of 0.0 to 1.0. Implement this behavior in Impeller and document it in dart:ui (Framework also needs to be documented). This also matches the w3c gradient behavior: https://www.w3.org/TR/2000/CR-SVG-20000802/pservers.html - almost. We might be slightly off with how we're inserting additional stops for 0.0 and 1.0, but at least its closer.

Fixes https://github.com/flutter/flutter/issues/132792
2023-09-27 19:48:19 +00:00
Jason Simmons
c53ee75553 Declare native wrapper classes in the GPU package as base classes (flutter/engine#46304)
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 14:44:54 +00: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
Harry Terkelsen
bb6b1aaff0 [canvaskit] Use DirectionalLight_Shadow flag for drawing shadows (flutter/engine#46292)
Use the DirectionalLight_Shadow flag when drawing shadows in CanvasKit.
This fixes bugs with drawing shadows in tests with different device
pixel ratios.

## 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-26 12:31:57 -07:00
gaaclarke
59e71967ce Clean up the docstring for ColorFilter.matrix (flutter/engine#46298)
The first line is important since it is pulled out into https://api.flutter.dev/flutter/dart-ui/ColorFilter-class.html.  The existing wording is very confusing about what the input actually is.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-26 18:38:43 +00:00
dependabot[bot]
5945696711 Bump uuid from 4.0.0 to 4.1.0 in /lib/web_ui (flutter/engine#46293)
Bumps [uuid](https://github.com/Daegalus/dart-uuid) from 4.0.0 to 4.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Daegalus/dart-uuid/releases">uuid's releases</a>.</em></p>
<blockquote>
<h1>4.1.0</h1>
<ul>
<li><strong>[BREAKING CHANGE]</strong> In order to enforce lowercase strings in <code>UuidValue</code>, I have made the default const constructor private, and added a <code>fromString</code> factory constructor. Please migrate any direct <code>UuidValue()</code> usage to <code>UuidValue.fromString()</code> or <code>UuidValue.withValidation()</code>.</li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/daegalus/dart-uuid/compare/4.0.0...4.1.0">https://github.com/daegalus/dart-uuid/compare/4.0.0...4.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/daegalus/dart-uuid/blob/main/CHANGELOG.md">uuid's changelog</a>.</em></p>
<blockquote>
<p>v4.1.0</p>
<ul>
<li><strong>[BREAKING CHANGE]</strong> In order to enforce lowercase strings in <code>UuidValue</code>, I have made the default const constructor private, and added a <code>fromString</code> factory constructor. Please migrate any direct <code>UuidValue()</code> usage to <code>UuidValue.fromString()</code> or <code>UuidValue.withValidation()</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f4a6b226a2"><code>f4a6b22</code></a> Fix test</li>
<li><a href="897561eeed"><code>897561e</code></a> Update Docs</li>
<li><a href="404a86a32b"><code>404a86a</code></a> Change privatize UuidValue and add new factory constructor.</li>
<li><a href="2c9c74d0fc"><code>2c9c74d</code></a> Pubspec info update</li>
<li>See full diff in <a href="https://github.com/Daegalus/dart-uuid/compare/4.0.0...4.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uuid&package-manager=pub&previous-version=4.0.0&new-version=4.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
2023-09-26 18:32:16 +00:00
Kenzie Davisson
e70d4a1c1b Add description to assert in history.dart (flutter/engine#46072)
I have hit this assertion error many times in tests and this message
would be helpful for debugging.

---------

Co-authored-by: Mouad Debbar <mdebbar@google.com>
2023-09-25 10:57:44 -07:00
dependabot[bot]
d3648e637a Bump archive from 3.3.9 to 3.4.2 in /lib/web_ui (flutter/engine#46253)
Bumps [archive](https://github.com/brendan-duncan/archive) from 3.3.9 to 3.4.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/brendan-duncan/archive/blob/main/CHANGELOG.md">archive's changelog</a>.</em></p>
<blockquote>
<h2>3.4.2 - September 23, 2023</h2>
<ul>
<li>Add bzip2 decompression for zip files.</li>
</ul>
<h2>3.4.1 - September 23, 2023</h2>
<ul>
<li>Fix for decoding zip64 zip files that have multiple extra fields.</li>
</ul>
<h2>3.4.0 - September 21, 2023</h2>
<ul>
<li>Add Zip64 support to ZipEncoder to allow it to create zip files &gt; 4GB.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3fe2f348b0"><code>3fe2f34</code></a> Update to 3.4.2</li>
<li><a href="7ebfdfe345"><code>7ebfdfe</code></a> Throw exception for unsupported zip compression methods</li>
<li><a href="2a6c51b6a5"><code>2a6c51b</code></a> Add bzip2 decompression for zip files</li>
<li><a href="3bd14c0a22"><code>3bd14c0</code></a> Update to 3.4.1</li>
<li><a href="e2ae50513d"><code>e2ae505</code></a> Fix for zip files that have multiple extra fields</li>
<li><a href="9171becaa6"><code>9171bec</code></a> Update to 3.4.0</li>
<li><a href="6fdd35c7df"><code>6fdd35c</code></a> Add zip64 support to ZipEncoder to handle files &gt; 4GB; reduce memory for enco...</li>
<li>See full diff in <a href="https://github.com/brendan-duncan/archive/compare/3.3.9...3.4.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=archive&package-manager=pub&previous-version=3.3.9&new-version=3.4.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
2023-09-25 09:02:05 +00:00