3655 Commits

Author SHA1 Message Date
gaaclarke
df9fc7786b Reland: Framework wide color (#54415) (#54737) (flutter/engine#54905)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted
because it required customer testing updates.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes: 1) colors now specify
a colorspace with which they are to be interpreted 1) colors now store
their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this: 1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color 1) Land another engine PR that
rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered 1)
https://github.com/flutter/engine/pull/54567 - Hooks up these changes to
take advantage of wide DlColor 1)
https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking: 1) The math on `lerp` hasn't been updated to
take advantage of the higher bit depth 1) `operator==` hasn't been
updated to take advantage of the higher bit depth 1) `hashCode` hasn't
been updated to take advantage of the higher bit depth 1) `alphaBlend`
hasn't been updated to take advantage of the higher bit depth 1)
`toString` hasn't been updated to take advantage of the higher bit depth

## Reland 2 notes

This was reverted because it changes the math on `_lerpDouble`. While
those changes were mathematcially equivalent, they had different
behaviors when working with non-numbers which created unexpected
changes. The change has been reverted and a test added.

## 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-08-30 10:33:07 -07:00
auto-submit[bot]
7b38e8d173 Reverts "Reland: Framework wide color (#54415) (#54737)" (flutter/engine#54885)
Reverts: flutter/engine#54737
Initiated by: chingjun
Reason for reverting: Breaking internal tests. See b/363125155
Original PR Author: gaaclarke

Reviewed By: {matanlurey, jonahwilliams}

This change reverts the following previous change:
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-30 04:31:26 +00:00
auto-submit[bot]
677c70aa8a Reverts "Hooks up framework wide gamut to engine wide gamut (#54567)" (flutter/engine#54884)
Reverts: flutter/engine#54567
Initiated by: chingjun
Reason for reverting: Breaking internal tests. See b/363125155
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams, chinmaygarde}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-30 04:27:48 +00:00
gaaclarke
fdc343efec Hooks up framework wide gamut to engine wide gamut (flutter/engine#54567)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-29 23:22:07 +00:00
gaaclarke
3b2f540e54 Reland: Framework wide color (#54415) (flutter/engine#54737)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-29 19:02:59 +00:00
Jackson Gardner
c518ebc094 [skwasm] Always do backdrop filter operation even if empty. (flutter/engine#54844)
This is a partial fix for https://github.com/flutter/flutter/issues/152026

We are still blocked on https://g-issues.skia.org/issues/362552959 for things to be completely working.
2024-08-28 21:19:54 +00:00
Ömer Sinan Ağacan
8da579925c Compile dart2wasm modules using the JS runtime exported compileStreaming (flutter/engine#51488)
With [1] dart2wasm started using the new Wasm built-in string import
`wasm:js-string`.

With [2] dart2wasm started exporting `compile` and `compileStreaming`
from the generated JS runtime to compile dart2wasm-generated modules
with the `wasm:js-string` built-in, polyfilling it when not available.

Update Wasm compilation code in Flutter to use `compileStreaming` from
the JS runtime, enabling fast `jwasm:js-string` module when available.

[1]: 44c2e17600
[2]: 4cd6096da4
2024-08-28 20:00:51 +02:00
Matan Lurey
d54ae5d4e3 Change the ci/analyze.sh script to analyze _all_ of the engine (flutter/engine#54779)
Closes https://github.com/flutter/flutter/issues/152636.

As of this PR, we no longer cherry-pick specific directories to run `dart analyze` on.

A few trailing errors across the repo had to be fixed in this PR.
2024-08-26 20:35:08 +00:00
Yegor
dce257d97f [web] set the "dialog" ARIA role unconditionally (flutter/engine#54761)
Previously the "dialog" ARIA role was only set if the route or any of its descendants had the `namesRoute` flag. This PR sets the ARIA role unconditionally. Although it's always a good idea to have a label on the route, a missing label doesn't change the fact that the route is a route, so the ARIA role should still be set.

Fixes https://github.com/flutter/flutter/issues/153791
2024-08-26 18:36:32 +00:00
Jonah Williams
c88eb87bd5 [ui] fix missing color conversion in drawAtlas. (flutter/engine#54750)
Ensure that int32 ui colors are correctly converted to Dl Colors (convert instead of reinterpret cast).
2024-08-26 16:28:21 +00:00
Mouad Debbar
ff452d94a3 [web] Multi-view support for Skwasm (flutter/engine#48893)
Support multi-view mode in the Skwasm renderer.

Fixes https://github.com/flutter/flutter/issues/138925
2024-08-23 15:20:07 +00:00
Jim Graham
2932511ae8 Revert "Framework wide color" (flutter/engine#54728)
Reverts flutter/engine#54415

Reverting for failures in the engine roll: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8738846858081700577/+/u/run_test.dart_for_customer_testing_shard_and_subshard_None/stdout
2024-08-23 08:11:16 +00:00
Matan Lurey
d68876bb1d More diagnostic clean ups (flutter/engine#54265)
Towards https://github.com/flutter/flutter/issues/152636.

Almost all changes are `dart --fix`.
2024-08-22 21:04:17 +00:00
gaaclarke
6f9776424c Framework wide color (flutter/engine#54415)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes:
1) colors now specify a colorspace with which they are to be interpreted
1) colors now store their components as floats to accommodate bit depths
more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage:
https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes
to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the
higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit
depth
1) `hashCode` hasn't been updated to take advantage of the higher bit
depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit
depth
1) `toString` hasn't been updated to take advantage of the higher bit
depth

## 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-08-22 12:36:28 -07:00
Yegor
41041672af [web:semantics] fix double click due to long-press (flutter/engine#54697)
Remember the timestamp of _all_ `pointerup` events, not just those that were flushed. Clicks should be deduplicated after a `pointerup` even when not debouncing anything. This is because when not debouncing the engine already forwards all the pointer events to the framework, and sending click events on top only causes double-clicks.

Fixes https://github.com/flutter/flutter/issues/147050
2024-08-22 17:54:47 +00:00
Jonah Williams
02a6c7a676 [Impeller] use blit pass to resize decoded images. (flutter/engine#54606)
Fixes https://github.com/flutter/flutter/issues/153623
Fixes https://github.com/flutter/flutter/issues/153788

* Avoids slow CPU resizer
* Avoids us having to write any code at all to resize these images
* Avoids reading from the GPU staging buffers that are not read cached (similar to Glyph cache performance issues).

Also changes the single frame codec upload to either use the device private storage path or to defer upload until the GPU returns. This allows us to ensure that mips are always constructed and makes sure that we don't need to keep around the CPU texture reisze that depends on the Skia software backend.

Separately, I updated the deferred task system to allow separate success/failure tasks to make it easier to track the final state.
2024-08-21 20:22:09 +00:00
Yegor
79a6989314 [web] annotate obscured text fields as passwords (flutter/engine#54664)
The `type` attribute is needed for screen readers to tell the user whether the text field is a password or a plain text field.

Use `-webkit-text-security` for multi-line fields as a best effort (it's non-standard but is supported by all major browsers).

Fixes https://github.com/flutter/flutter/issues/153801
2024-08-21 17:40:04 +00:00
Jason Simmons
164eb442db Remove unnecessary breaks in default clauses of switch statements (flutter/engine#54669)
See https://dart.googlesource.com/sdk.git/+/045d26bc74209f5acc6466669f89686344e83de2
2024-08-21 04:31:26 +00:00
gaaclarke
a6c6c50a25 Changes DlColor to support wide gamut colors (#54473) (flutter/engine#54648)
relands https://github.com/flutter/engine/pull/54473
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This is the engine side changes required for wide gamut framework support.  It changes the internal representation of DlColor to be floats.  It will be married with https://github.com/flutter/engine/pull/54415 when it lands in https://github.com/flutter/engine/pull/54567.

## Difference from last attempt

1) The default color is now opaque black, not transparent black (not the issue for revert)
1) Updated a test to send in valid numbers when constructing a color and added asserts to avoid those problems in the future.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-20 21:44:24 +00:00
Srujan Gaddam
d16a9057a0 Update package:js version constraints to ^0.7.0 and update test versions to match (flutter/engine#54629)
This removes the dependency on `dart:js` and allows that library to be removed from dart2wasm. Also updates `test` dependencies to work with the new `package:js` constraints.
2024-08-20 02:58:58 +00:00
auto-submit[bot]
8aabbdd12f Reverts "Changes DlColor to support wide gamut colors (#54473)" (flutter/engine#54636)
Reverts: flutter/engine#54473
Initiated by: jonahwilliams
Reason for reverting: golden diffs like https://flutter-engine-gold.skia.org/detail?grouping=name%3Dimpeller_Play_AiksTest_BlendModeSrcAlphaLuminosity_OpenGLES%26source_type%3Dflutter-engine&digest=107ccd2cd1170746b1ffc4d31184e789 look incorrect, potentially an alpha issue
Original PR Author: gaaclarke

Reviewed By: {flar}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This is the engine side changes required for wide gamut framework support.  It changes the internal representation of DlColor to be floats.  It will be married with https://github.com/flutter/engine/pull/54415 when it lands in https://github.com/flutter/engine/pull/54567.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-20 02:19:47 +00:00
gaaclarke
1fde0ad466 Changes DlColor to support wide gamut colors (flutter/engine#54473)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This is the engine side changes required for wide gamut framework support.  It changes the internal representation of DlColor to be floats.  It will be married with https://github.com/flutter/engine/pull/54415 when it lands in https://github.com/flutter/engine/pull/54567.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-19 23:16:55 +00:00
Kevin Moore
28e7d0ec2a web_ui: bump min Dart SDK to 3.6.0-0 (flutter/engine#54626)
Also removed two unused dev dependencies

Enables usage of `Since` in dart:js_interop
2024-08-19 22:11:55 +00:00
Jackson Gardner
5e39c69831 [skwasm] Fix skwasm clip coverage algorithm. (flutter/engine#54572)
This previously was basically assuming that two clip regions would be a union but instead it's actually an intersection. Also, for some reason I had forgotten to actually implement `boundingRect` for the rrect clip region. I changed this for a bit more clarity.
2024-08-19 21:45:07 +00:00
Harry Terkelsen
e0529ddd81 [canvaskit] Improve how overlays are optimized (flutter/engine#54547)
Enhances the overlay optimization by pushing new pictures to the earliest RenderCanvas they can go into. This improvement is made especially clear in the new test case I added to `embedded_views_test.dart`, with the previous algorithm we would have used an overlay for each platform view even though all of the pictures could go into the base canvas with no issue.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-15 22:23:00 +00:00
Oleg Magomedov
e55ebe1d32 Fix typo in AppLifecycleState documentation (flutter/engine#54544)
Fixes small typo in AppLifecycleState enum documentation. Documentation to enum references iOS article about managing app lifecycle in UIKit. So, "IOKit" is a misspelled word "UIKit"

I found out Apple has [IOKit framework](https://developer.apple.com/documentation/iokit) but it is not related to app lifecycle

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-15 20:27:39 +00:00
Michael Thomsen
177a661383 Update dartdoc for gpu.dart (flutter/engine#54529)
Update dartdoc for package:flutter_gpu with:
1) details on how to use the sdk dep
2) the current docs link

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-13 21:16:15 +00:00
Harry Terkelsen
3c7746ee1f [canvaskit] Add animation detection for GIFs (flutter/engine#54483)
Detect if a GIF is animated to determine if we need to use Skia to decode it or if we can use <img> tag decoding.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-13 21:00:58 +00:00
Brandon DeRosier
b19fe31562 Revert "[Impeller] remove scene3d support." (flutter/engine#54502)
Reverts flutter/engine#54453

Not quite ready to remove Impeller Scene yet because I'm still porting
the animation functionality. Keeping it around allows me to switch back
and forth to compare without having to recompile the engine.

Over a month ago I said something like "we can revert this a couple of
weeks from now" in one of the Impeller meetings. But for better or worse
(better, I think), I ended up spending a ton of time trying to make the
PBR good first (which doesn't exist in this C++ version).
2024-08-12 10:28:51 -07:00
Jonah Williams
198d1f1077 [Impeller] remove scene3d support. (flutter/engine#54453)
Now that Flutter GPU is a preview, the technical debt from having an ifdef controlled additional rendering mode can be removed.
2024-08-09 16:38:56 +00:00
Harry Terkelsen
a7481bd5d5 [canvaskit] Detect animated WebP images (flutter/engine#54418)
Reads the WebP header to determine if the WebP image is animated or not. If it's not animated, we can use `<img>` tag decoding for less jank.

The WebP half of https://github.com/flutter/flutter/issues/151911

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-08 21:47:22 +00:00
Michael Thomsen
7e52a7c53b Update pubspec.yaml for package:flutter_gpu (flutter/engine#54345)
Update readme for package:flutter_gpu to have an appropriate description
and, fill out the pub [repo
field](https://dart.dev/tools/pub/pubspec#repository).

## 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-08-06 12:21:38 +02:00
Jackson Gardner
2b915b5444 [skwasm] Implement platform view clipping. (flutter/engine#54201)
This implements platform view clipping for the Skwasm renderer.

This fixes https://github.com/flutter/flutter/issues/133466
2024-08-01 22:12:14 +00:00
Jason Simmons
d103053ca2 [web] Dispose a temporary image that may be created by instantiateImageCodecWithSize (flutter/engine#54096)
Fixes https://github.com/flutter/flutter/issues/147066
2024-07-31 22:40:51 +00:00
Yegor
38f3b2c83b [web] rename dialog to route to match the framework (flutter/engine#54228)
Rename "dialog" to "route" to match the framework. The ARIA role "dialog" is an implementation detail, and it might change if a better implementation comes along. The semantic node itself implements the framework's "route" concept.
2024-07-31 17:18:11 +00:00
Harry Terkelsen
55ac232563 enumify ImageType and ImageFileSignature (flutter/engine#54131)
Use enhanced enums to clarify the image detection code.

Part of a refactor towards https://github.com/flutter/flutter/issues/151911

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-30 23:59:22 +00:00
Alexander Aprelev
69692c0807 Remove obsolete dependency from few more targets. (flutter/engine#54181)
Follow-up to 9cfb0f4947a23937fe5d88b105645e2c1942ba85 - remove obsolete
dependency from few more places that were missed.
2024-07-29 09:37:43 -07:00
Jason Simmons
8165d2a54a [web] Fix scaledImageSize handling of a target width with no target height (flutter/engine#54122) 2024-07-29 16:27:37 +00:00
Alexander Aprelev
9cfb0f4947 Remove obsolete dependency (flutter/engine#54161)
The concurrent_api/concurrent_api_product targets were made obsolete by
95f5efc697
2024-07-27 07:18:17 -07:00
Matan Lurey
e301288885 Pub workspace-ify most of testing/ and parts of tools/ (flutter/engine#54124)
Replaces and closes https://github.com/flutter/engine/pull/53997.

This PR migrates the following packages to the pub workspace:
  - testing/benchmark
  - testing/dart
  - testing/litetest
  - testing/pkg_test_demo
  - testing/scenario_app
  - testing/skia_gold_client
  - testing/symbols
  - tools/golden_tests_harvester
  - tools/pkg/process_fakes

It also makes minor changes to the Dart build rules in order to resolve the root package_config, instead of per-package.

I am _not_ totally confident of the `_embedder.yaml` change, but I also can't explain what is needed to continue analyzing `lib/ui` without analysis failures that all of the symbols in `dart:nativewrappers` are missing.
2024-07-26 17:35:50 +00:00
Harry Terkelsen
bb753d807f Refactor detectContentType to prepare for animation detection (flutter/engine#54127)
Refactor in preparation for https://github.com/flutter/flutter/issues/151911

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-25 22:59:24 +00:00
Srujan Gaddam
5ba4b01dfe Initial pass to cleanup dom.dart to use newer JS interop styles (flutter/engine#54093)
This only addresses the following:

- Removes `JSVoid` in favor of `void`. `JSVoid`, which is just a
typedef, should be deprecated and removed eventually.
- Removes extra interop methods that were needed to make sure arity was
correct. These are no longer needed as interop methods are
invocation-sensitive and calls to them do not forward more arguments
than were passed by the user.
- Removes unnecessary annotations on extensions.

Still left to do (not comprehensive):

- Migrate to extension types.
- Remove forwarding methods that are only used to convert primitives in
favor of changing the interop method to include the Dart primitive type.
It might be a bit slower in dart2wasm to do this, but will need to
verify and fix it if that's the case.
- Remove usage of `js_util`.
- See if we can replace types with their `package:web` equivalent for
easier maintenance.
2024-07-25 13:10:31 -07:00
Yegor
7de2134117 [web] better class names for semantics (flutter/engine#54070)
A few non-functional clean-ups in semantics:

* Rename `RoleManager` to `SemanticBehavior`.
* Rename `PrimaryRoleManager` to `SemanticRole`.
* Remove the `Role` enum. Move the enum docs into the respective classes.

## Why?

Previous naming was confusing. It's not clear what the difference is between a "role manager" and a "primary role manager". The word "manager" is a meaningless addition; the `Semantic*` prefix is much more meaningful. The `Role` enum was only used for tests, but tests can just use `SemanticRole.runtimeType`.

## New state of the world

After this PR the semantics system has "objects" (class `SemanticsObject`), "roles" (class `SemanticRole`), and "behaviors" (class `SemanticBehavior`).

- A semantic _object_ is an object attached to the framework-side `SemanticNode`. It lives as long as the semantic node does, and provides basic functionality that's common across all nodes.
- A semantic object has exactly one semantic _role_. This role is determined from the flags set on the semantic node. Flags can change, causing a semantic object to change its role, which is why these are two separate classes. If an object had just one permanent role, we could combine these classes into one (maybe one day we'll do it, as changing roles dynamically is weird, but that needs major changes in the framework).
- A semantic role may have zero or more semantic _behaviors_. A behavior supplies a piece of functionality, such as focusability, clickability/tappability, live regions, etc. A behavior can be shared by multiple roles. For example, both `Button` and `Checkable` roles use the `Tappable` behavior. This is why there's a many-to-many relationship between roles and behaviors.

Or in entity relationship terms:

```mermaid
---
title: Semantic object relationships
---
erDiagram
    SemanticsNode ||--|| SemanticsObject : managed-by
    SemanticsObject ||--o{ SemanticRole : has-a
    SemanticRole }o--o{ SemanticBehavior : has
```
2024-07-25 02:42:05 +00:00
Chris Bracken
c100e07c9e [iOS] Build universal gen_snapshots for iOS (flutter/engine#54009)
This merges the macOS and iOS rules for creating the `gen_snapshot_arm64` and `gen_snapshot_x64` used to build for iOS devices, as well as for iOS simulators on both arm64 hosts (`gen_snapshot_arm64`) and x64 hosts (`gen_snapshot_x64`). The macOS rules have already been updated to generate universal binaries for each of these that can be run on both Apple Silicon and Intel Mac hosts.

This also updates `create_full_ios_framework.py` to bundle the newly-generated universal gen_snapshot binaries and produce the artifacts.zip archive that is uploaded via the build config in `mac_ios_engine.json`.

The `create_arm_gen_snapshot` rule remains until I'm 100% convinced it's not used for macOS host Android target builds.

Issue: https://github.com/flutter/flutter/issues/101138
Issue: https://github.com/flutter/flutter/issues/69157

This is stacked on top of https://github.com/flutter/engine/pull/54008.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-24 21:56:16 +00:00
Jackson Gardner
851a3e5829 [skwasm] Fix platform view occlusion logic. (flutter/engine#54061)
The occlusion rectangle for platform views was going through this `inverseMapRect` code path, which actually was giving us the wrong results. The operations should just be doing the normal transformation on the rectangles to get the right result. It actually turns out we don't need the inverse mapping function, so I removed it, and I renamed the somewhat confusingly named `cullRect` function to `mapRect` which I think makes a bit more sense.

This should resolve https://github.com/flutter/flutter/issues/152139
2024-07-24 17:48:48 +00:00
Srujan Gaddam
0f69778e71 Change JSArray.length to return int (flutter/engine#54051)
This is in preparation for
https://dart-review.googlesource.com/c/sdk/+/373884, which will add length to the extension type itself. This will shadow the extension member, so we should make sure the type signatures match.
2024-07-24 01:12:19 +00:00
Harry Terkelsen
9e797d1461 [canvaskit] Decode images using <img> tag decoding (flutter/engine#53201)
Prefer to decode images using the browser API rather than with CanvasKit to avoid jank when decoding.

Part of deprecating the HTML renderer: https://github.com/flutter/flutter/issues/145954

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-19 17:41:05 +00:00
auto-submit[bot]
7b931a25de Reverts "Reverts "Drop deprecated hash_code functions (#54000)" (#54002)" (flutter/engine#54004)
Reverts: flutter/engine#54002
Initiated by: kevmoo
Reason for reverting: the issue in google 3 has been fixed.
Original PR Author: auto-submit[bot]

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
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 14:54:29 +00:00
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