3440 Commits

Author SHA1 Message Date
Matan Lurey
31b0fb1ea3 Remove or replaced unused or duplicate code in SkiaGoldClient. (flutter/engine#51399)
- `get isAvailable` -> `SkiaGoldClient.isAvailable()`
- `get isLuciEnv` -> `SkiaGoldClient.isLuciEnv()`
- Remove unused `SkiaGoldHttpOverrides`
2024-03-14 08:45:34 -07:00
Yegor
826074672d [web] make text more crawlable; fix a JAWS bug (flutter/engine#50794)
On Windows, where JAWS is a popular screen reader and, [unfortunately](https://github.com/FreedomScientific/standards-support/issues/759), ignores `aria-label` on empty elements, and for user agents that are known web crawlers (that also ignore `aria-label`), render semantic text into the DOM using an additional `<span>` element.

Fixes https://github.com/flutter/flutter/issues/122607
2024-03-13 23:03:00 +00:00
Juanjo Tugores
db857bd325 Implement PlatformDispatcher.requestViewFocusChange on web. (flutter/engine#50535)
Implement PlatformDispatcher.requestViewFocusChange on web. 

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-13 17:37:44 +00:00
Chinmay Garde
6a151f5c40 [Impeller] Make masks type safe. (flutter/engine#51369)
Uses the utility added in https://github.com/flutter/engine/pull/51361

I counted the removal of 58 static casts. There was one addition made to the original utility however. Vulkan HPP was promoting all enums to its own mask type. This in itself is problematic but we got away with it because there was no one else doing this kind of promotion. Till we added our own utility. To avoid polluting the namespace with methods that may cause ambiguity, enums that are masks must explicitly be marked as maskable with `IMPELLER_ENUM_IS_MASK` in the `impeller` namespace.

No change in functionality.
2024-03-13 00:12:21 +00:00
Brandon DeRosier
fa6808182c Remove early Flutter GPU prototype from ui/experiments. (flutter/engine#51367)
We moved to lib/gpu some time ago!
(Initially added with https://github.com/flutter/engine/pull/42228)
2024-03-12 16:09:58 -07:00
Pavel Mazhnik
a9c40d24b7 [web] make addView/removeView functions sync (flutter/engine#51103)
Related to https://github.com/flutter/flutter/issues/138930
2024-03-12 22:29:27 +00:00
Loïc Sharma
b2f119de6b [dart:ui] Add view ID to PointerData.toString (flutter/engine#51352)
The `view_id` is useful information as the pointer's `x` and `y` coordinates are relative to the view's origin.

Part of https://github.com/flutter/flutter/issues/112205
Part of https://github.com/flutter/flutter/issues/142845

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-12 21:53:41 +00:00
Jackson Gardner
f646f9a40c Reland "Move emscripten out of the buildroot into the flutter repo" (flutter/engine#51353)
This is a reland of the change moving the emsdk out of the buildroot, but without the removal of `web_dependencies`, since that removal was causing issues with the rollers.
2024-03-12 18:32:08 +00:00
David Iglesias
e62c718145 [web] Split initialization of the _flutter namespace and loader object. (flutter/engine#51294)
This makes it possible to more flexibly compose `{{flutter_js}}` and `{{flutter_build_options}}` in @eyebrowsoffire's [bootstrapping improvements PR](https://github.com/flutter/flutter/pull/144434).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-11 23:21:17 +00:00
auto-submit[bot]
0c2c540e72 Reverts "Move emscripten out of the buildroot into the flutter repo. (#51299)" (flutter/engine#51330)
Reverts: flutter/engine#51299
Initiated by: zanderso
Reason for reverting: Blocking the autoroller
Original PR Author: eyebrowsoffire

Reviewed By: {matanlurey}

This change reverts the following previous change:
This migrates the emscripten toolchain into the flutter repo, as well as the fonts for web unit tests. Also, removed the `web_dependencies` thing which is no longer used.

This fixes https://github.com/flutter/flutter/issues/143332

Depends on a buildroot change here: https://github.com/flutter/buildroot/pull/833
2024-03-11 20:39:25 +00:00
Jackson Gardner
048ee12c07 Move emscripten out of the buildroot into the flutter repo. (flutter/engine#51299)
This migrates the emscripten toolchain into the flutter repo, as well as the fonts for web unit tests. Also, removed the `web_dependencies` thing which is no longer used.

This fixes https://github.com/flutter/flutter/issues/143332

Depends on a buildroot change here: https://github.com/flutter/buildroot/pull/833
2024-03-11 17:24:19 +00:00
Juanjo Tugores
976d528d71 Mark the Flutter Views as focusable by setting a tabindex value. (flutter/engine#50876)
Mark the Flutter View as focusable by setting a tabindex value.

* When a given flutter view is focused its tabindex will be `-1`
* When a given flutter view is not focused its tabindex will be `0`
* When semantics are enabled no tabindex will be set.

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-08 23:36:16 +00:00
Harry Terkelsen
4c86674a0f Optimize overlays in CanvasKit (flutter/engine#47317)
Optimize overlays by detecting when Flutter-rendered content intersects
with platform views. Overlay canvases are only needed when the content
intersects, so by checking for this, we can optimize out most overlays.

## 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-03-08 14:28:24 -08:00
Juanjo Tugores
1e38a17a22 Prepend the accessibility placeholder (flutter/engine#51050)
Prepends the accesibility placeholder. Previously it was being appended (last child) to the body. 

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-07 18:16:21 +00:00
Martin Kustermann
572d662658 Make @keepToString annotation work for web and non-web (flutter/engine#51251)
* Update documentation for the annotation
* Add `@keepToString` annotation to web's `Locale` class (similar to
non-webs `Locale` class)

Issue https://github.com/flutter/flutter/issues/52759
2024-03-07 10:33:13 +01:00
Tong Mu
67603e5e32 Reland 5: Multiview pipeline (flutter/engine#51186)
This relands https://github.com/flutter/engine/pull/50931.

The crash that caused the 4th revert has been fixed by https://github.com/flutter/flutter/pull/144212.

[There has been discussion](https://github.com/flutter/engine/pull/51019) on why the benchmark in previous attempts show significant drop in build time. This PR addresses it using option a as described in [this comment](https://github.com/flutter/engine/pull/51186#issuecomment-1977820525).

This PR also addresses https://github.com/flutter/flutter/issues/144584 with option 1. A test is added.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-07 01:54:14 +00:00
LongCatIsLooong
8fd9bbee17 Reland "Remove migration flag and unused header files #50216" (flutter/engine#50259)
Forgot to update a pinned dependency in the previous attempt: https://github.com/flutter/tests/pull/340

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-05 02:17:05 +00:00
Liam Appelbe
27ca389132 Experimental platform isolates API (flutter/engine#48551)
This is a prototype of the [PlatformIsolate
API](https://github.com/flutter/flutter/issues/136314).

**UPDATE (Jan 25):** The PR is ready for review. PTAL.

The `PlatformIsolate` creation flow is:

1. `PlatformIsolate.spawn` running on parent isolate
(platform_isolate.dart)
    a. Create `isolateReadyPort`
    b. `PlatformIsolateNativeApi::Spawn` (platform_isolate.cc)
    c. `DartIsolate::CreatePlatformIsolate` (dart_isolate.cc)
d. Isolate created. Entry point invocation task dispatched to platform
thread
    e. `PlatformIsolate.spawn` returns a `Future<Isolate>`
2. On the platform thread, `_platformIsolateMain` is invoked in the
platform isolate
    a. Create `entryPointPort`
b. Send `Isolate.current` metadata and `entryPointPort` back to the
parent isolate via `isolateReadyPort`
3. Back in the parent isolate, `isolateReadyPort.handler` is invoked
a. Send the user's `entryPoint` and `message` to the platform isolate
via `entryPointPort`
b. Use received isolate metadata to create a new `Isolate` representing
the platform isolate and complete the `Future<Isolate>`
4. In the platform isolate, `entryPointPort.handler` is invoked
    a. Run the user's `entryPoint(message)`

The engine shutdown flow is handled by `PlatformIsolateManager`, which
maintains a set of running platform isolates.
2024-03-04 16:47:41 +13:00
Jackson Gardner
0424f1f86e Reland "[skwasm] Clip pictures if they go beyond the bounds of the window." (flutter/engine#51077)
This fixes https://github.com/flutter/flutter/issues/143800, where we are attempting to capture an image that is way too large. We only need to render the part of the image that will be visible in the window.

This includes some additional fixes for regressions in the original fix.
2024-02-29 21:06:02 +00:00
Kevin Moore
7ba403293e [web] Drop noisy prints from bootstrapping logic (flutter/engine#51097)
Fixes https://github.com/flutter/flutter/issues/143976
2024-02-29 20:00:22 +00:00
Jackson Gardner
3615c28ff8 Fix a few issues rendering text with Skwasm. (flutter/engine#51074)
This fixes https://github.com/flutter/flutter/issues/141001
This also fixes https://github.com/flutter/flutter/issues/143743

* We need to always call `setStrutEnabled(true)` on `StrutStyle`.
* `getLineMetricsAt` had reversed ternary logic.
* We also need to apply the rounding hack in Skwasm.
* Ported unit tests from CanvasKit over to UI to cover Skwasm ~and HTML~
* ~The HTML renderer should return 0 line metrics for an empty paragraph.~
2024-02-29 19:42:09 +00:00
Jackson Gardner
c98ee51b1e Revert "[skwasm] Clip pictures if they go beyond the bounds of the window. (#50887)" (flutter/engine#51067)
This reverts commit 3af9b7b3baa33896103d286d3e4593f95b87b7a7.

The change is causing skwasm benchmarks to flake. See https://ci.chromium.org/ui/p/flutter/builders/luci.flutter.prod/Linux%20web_benchmarks_skwasm
2024-02-28 21:20:00 +00:00
Sam Rawlins
c86194e544 Null-assert the value given to a Completer expecting a non-null value (flutter/engine#49053)
The code with out the null assertion is legal as per the type signature,
but will throw a runtime exception if the nullable value is null. To
make this exception more explicit, the value must be null-checked before
completing the completer with the value.

The analyzer will soon enforce such checks. See dart-lang/sdk#53253.

This PR is behaviorally a no-op.

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


## 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.
- [ ] 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-02-27 17:27:24 -08:00
Jonah Williams
edb8430817 [Impeller] various StC fixes for GPU -> CPU readback plus BufferBindingGLES error (flutter/engine#50951)
More debugging for https://github.com/flutter/engine/pull/50856

Potentially related to https://github.com/flutter/flutter/issues/141472
2024-02-27 20:35:18 +00:00
Jackson Gardner
3af9b7b3ba [skwasm] Clip pictures if they go beyond the bounds of the window. (flutter/engine#50887)
This fixes https://github.com/flutter/flutter/issues/143800, where we are attempting to capture an image that is way too large. We only need to render the part of the image that will be visible in the window.
2024-02-27 18:37:25 +00:00
Jackson Gardner
fce1fe5b2c Reland "Implement Frame Timing callbacks in Skwasm" (flutter/engine#50987)
This is a reland of the previous PR, now that the blocking Dart SDK issue has been fixed (see https://github.com/dart-lang/sdk/issues/54991).

Also, I addressed an issue where the timings were incorrect due to different time origins on the main thread and web worker. The timings should be accurate now.

Notes from the original PR are as follows:

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

Some notes here:
* Refactored the frame timing systems so that we can deal with asynchronous rendering.
* Consolidated rendering of multiple pictures in skwasm into a single call, so that the rasterization can be properly measured.
* Pulled the frame timings tests into the `ui` test suite so that they run on all renderers (including skwasm).
2024-02-27 16:42:25 +00:00
Tong Mu
c139338825 Revert "Reland 4: Multiview pipeline (#50931)" (flutter/engine#50985)
This reverts commit cb110ebc948c362cec5ac921cf8ef5e9ca530102.

Reason: Internal test failure blocking roll
OCL:610420483:BASE:610486571:1708978396098:f2c3c31

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-27 00:58:22 +00:00
Jackson Gardner
d1d7c08ce9 Make sure to call setHeightOverride as well on TextStyle and StrutStyle (flutter/engine#50920)
This fixes https://github.com/flutter/flutter/issues/143877

We apparently need to call `setHeightOverride(true)` on `TextStyle` and `StrutStyle` objects in order to properly apply the height.
2024-02-26 18:52:59 +00:00
Jackson Gardner
45b0c5ef88 Correctly offset the cull rect of the opacity layer. (flutter/engine#50928)
This fixes https://github.com/flutter/flutter/issues/140999. Previously, the cull rect would be misplaced causing many elements to not render at all.
2024-02-26 18:52:56 +00:00
Dan Field
f235a65897 Avoid reloading font collection for spawned engines with compatible asset managers (flutter/engine#50897)
@jason-simmons @jiahaog fyi

I need to figure out a test for this still but it seems to work. Hot restart is kind of a mess though, because `Engine::Restart` nulls out the asset manager it ends up reloading the font collection for every engine after a restart. But we separately need to fix hot restart, it's not very usable on the example app 

Fixes https://github.com/flutter/flutter/issues/143701
2024-02-24 14:58:37 +00:00
Tong Mu
cb110ebc94 Reland 4: Multiview pipeline (flutter/engine#50931)
This relands https://github.com/flutter/engine/pull/49950.

Nothing is changed. The error turns out a flake (it passes once),
although this PR might have made the flake more flaky.

## 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
2024-02-23 20:52:53 -08:00
auto-submit[bot]
c388fc8bf0 Reverts "Reland 3: Multiview pipeline (#49950)" (flutter/engine#50929)
Reverts flutter/engine#49950

Initiated by: dkwingsmt

Reason for reverting: Head redness 
```
java.lang.RuntimeException: Timeout waiting for firstFrameLatch to signal
	at dev.flutter.scenarios.ExternalTextureFlutterActivity.waitUntilFlutterRendered(ExternalTextureFlutterActivity.java:98)
	at dev.flutter.scenariosui.ScreenshotUtil.capture(ScreenshotUtil.java:122)
```

Original PR Author: dkwingsmt

Reviewed By: {loic-sharma}

This change reverts the following previous change:
Original Description:
This is the 3rd attempt to land multiview pipeline, following
https://github.com/flutter/engine/pull/47239.

The pipeline now properly implements the required logic for
`scheduleWarmUpFrame` to work in a multi-view setup, following the
preparation in https://github.com/flutter/flutter/pull/143290 and
https://github.com/flutter/engine/pull/50570.

## 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

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2024-02-23 15:15:00 -08:00
Tong Mu
dd271d0880 Reland 3: Multiview pipeline (flutter/engine#49950)
This is the 3rd attempt to land multiview pipeline, following
https://github.com/flutter/engine/pull/47239.

The pipeline now properly implements the required logic for
`scheduleWarmUpFrame` to work in a multi-view setup, following the
preparation in https://github.com/flutter/flutter/pull/143290 and
https://github.com/flutter/engine/pull/50570.

## 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
2024-02-23 13:39:54 -08:00
auto-submit[bot]
5cb500ca6e Reverts "Implement frame timing callbacks in Skwasm. (#50737)" (flutter/engine#50895)
Reverts flutter/engine#50737

Initiated by: goderbauer

Reason for reverting: Fails in device lab, see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8755350727803344657/+/u/run_web_benchmarks_skwasm/stdout

Original PR Author: eyebrowsoffire

Reviewed By: {mdebbar, yjbanov}

This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/140429

Some notes here:
* Refactored the frame timing systems so that we can deal with asynchronous rendering.
* Consolidated rendering of multiple pictures in skwasm into a single call, so that the rasterization can be properly measured.
* Pulled the frame timings tests into the `ui` test suite so that they run on all renderers (including skwasm).
2024-02-22 23:40:17 +00:00
Jackson Gardner
ed2ceeb022 Implement frame timing callbacks in Skwasm. (flutter/engine#50737)
Fixes https://github.com/flutter/flutter/issues/140429

Some notes here:
* Refactored the frame timing systems so that we can deal with asynchronous rendering.
* Consolidated rendering of multiple pictures in skwasm into a single call, so that the rasterization can be properly measured.
* Pulled the frame timings tests into the `ui` test suite so that they run on all renderers (including skwasm).
2024-02-22 19:52:44 +00:00
Juanjo Tugores
2bd7ee18c3 Add view focus direction detection to flutter web. (flutter/engine#50843)
Add view focus direction detection to flutter web.

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-22 01:26:10 +00:00
Tong Mu
c5e0858a01 Add scheduleWarmUpFrame (flutter/engine#50570)
This PR adds `PlatformDispatcher.scheduleWarmUpFrame`.

This PR is needed for the follow up changes:
* The framework will switch to using this function to render warmup
frames in https://github.com/flutter/flutter/pull/143290.
* Then the engine will finally be able to switch to multiview pipeline
with no regression on startup timing in
https://github.com/flutter/engine/pull/49950.

For why the warm up frame must involve the engine to render, see
https://github.com/flutter/flutter/issues/142851.


## 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
2024-02-21 16:46:11 -08:00
Juanjo Tugores
e9cfdd0277 Make the view focus binding report focus transitions across elements. (flutter/engine#50610)
Make the view focus binding report focus transitions across elements.

Previously the web engine reported all the focusin/focusout events as if the elements were first blurred before moving the focus.

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-21 23:02:58 +00:00
Zachary Anderson
f6629ffe5c Use 'et format' in CI. Check formatting of all files in CI (flutter/engine#50810)
This PR changes the format check on CI to use the command added in
https://github.com/flutter/engine/pull/50747.

Additionally, while making this change, I noticed that the CI check was
not checking the formatting of all files, and that as a result, files
were present in the repo with incorrect formatting. I have fixed the
formatting and fixed the check to always check all files.
2024-02-21 09:38:08 -08:00
Bruno Leroux
5e5052b8f9 [Web] Update modifier state when Meta key is seen as Process key (flutter/engine#50779)
## Description

On Web, browsers can emit key events with a logical key sets to `Process` when the physical key is MetaLeft. Because the modifier state is 0 despite Meta key being pressed this will trigger an assert.
This PR adds some logic for this specific case. Maybe a more slightly broader solution will be needed (using the same logic for all modifiers ?). I focused on MetaLeft because it was directly reported on  https://github.com/flutter/flutter/issues/141186.

## Related Issue

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

## Tests

Adds 1 test.
2024-02-21 05:37:08 +00:00
Brandon DeRosier
21bb5f4bda [Flutter GPU] Fix symbol export for windows. (flutter/engine#50755)
Symbols weren't getting exported on Windows because the `FML_OS_WIN`
macro wasn't being imported.
2024-02-20 19:03:27 -08:00
Jonah Williams
3447737d89 [Impeller] more nullchecks in image decoder. (flutter/engine#50787)
Speculative fix for https://github.com/flutter/flutter/issues/138897 which cannot be reprouced.
2024-02-20 22:19:55 +00:00
Jackson Gardner
b8d198edc2 Temporarily disable goldens for Safari. (flutter/engine#50724)
Safari is producing too many golden diffs. See https://github.com/flutter/flutter/issues/143591. This disables them for now to stop the noise, but we should look into a longer term solution.
2024-02-16 21:14:10 +00:00
Martin Kustermann
0e6ffa7346 [web] Remove unused allowInterop usage in flutter web code (flutter/engine#50718)
The CLs that migrated to static interop forgot to update the
corresponding comments regarding the need to use `allowInterop`.

The re-exported `allowInterop` function happened in an internal library
(not exposed via `dart:ui*`) and was unused.

Issue https://github.com/dart-lang/sdk/issues/54908
2024-02-16 21:46:42 +01:00
Michael Goderbauer
da30adfc6f Fix implementation imports outside of lib (flutter/engine#50727)
Work towards https://github.com/dart-lang/linter/issues/4859

There are libraries outside a `lib/` directory, which violate `implementation_imports`.
2024-02-16 20:19:33 +00:00
Bruno Leroux
4b5c993fe4 [Web] Ignore invalid keyboard events related to autofill (flutter/engine#50590)
## Description

This PR fixes an 'Unexpected null value' error related to autoFill.
When using Autofill feature, Chrome emits keyboard events whose `event.code` and `event.key` are null.

## Related Issue

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

## Tests

Adds 1 test.
2024-02-16 07:04:48 +00:00
Juanjo Tugores
ec948a8b48 Move the accesibility placeholder to the platform dispatcher. (flutter/engine#50608)
Move the accesibility placeholder to the platform dispatcher.

This change makes the platform dispatcher append a single accesibility placeholder, per app, to the `<body />`. Previous behavior was to insert a placeholder inside each `<flutter-view />`

Relevant Issues are:

* Design doc: https://flutter.dev/go/focus-management 
* Focus in web multiview: https://github.com/flutter/flutter/issues/137443
* Platform dispatcher changes: https://github.com/flutter/engine/pull/49841

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-15 22:07:58 +00:00
Renan
918d73b4aa fix: consider array size on canvaskit shader data (flutter/engine#49754)
This PR changes the ShaderData construction on canvaskit to consider array uniforms. 

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

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-15 15:23:12 +00:00
Chinmay Garde
6c17d7bf9d Use a GN variable (dart_src) to reference the location of the Dart checkout. (flutter/engine#50624)
Towards https://github.com/flutter/flutter/issues/143335
2024-02-14 21:12:23 -08:00
David Iglesias
45adab9726 [web] Add dynamic view sizing (v2) (flutter/engine#50271)
### Changes

* Introduces a new `viewConstraints` JS configuration parameter to configure max/min width/height constraints for a view. Those can have the following values:
  * An integer `>= 0`: max/min size in pixels
  * `Infinity` (or `Number.POSITIVE_INFINITY`): (only for max values) -> **unconstrained**.
  * When any value is not set, it defaults to "tight to the current size".
    * See [Understanding constraints](https://docs.flutter.dev/ui/layout/constraints).
* Computes the correct `physicalConstraints` of a view off of its `physicalSize` and its `viewConstraints` for the framework to use during layout.
  * When no constraints are passed, the current behavior is preserved: the default constraints are "tight" to the `physicalSize`.
* Resizes the current view DOM when requested by the framework and updates its internal physicalSize, then continues with the render procedure.

### Example

This is how we can configure a view to "take as much vertical space as needed":

```js
flutterApp.addView({
  viewConstraints: {
    minHeight: 0,
    maxHeight: Infinity,
  },
  hostElement: ...,
});
```

### TODO

* Needs actual unit tests

### Issues

* Fixes https://github.com/flutter/flutter/issues/137444
* Closes https://github.com/flutter/engine/pull/48541

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-15 00:56:57 +00:00