3826 Commits

Author SHA1 Message Date
Jim Graham
a10e25e727
[DisplayList] Migrate from SkRSXform to Impeller RSTransform (#161652)
Fixes SkRSXform task in https://github.com/flutter/flutter/issues/161456

Removes (nearly) all uses of Skia SkRSXform object from DisplayList and
replaces it with a new Impeller RSTransform geometry object.

There are remaining uses in:
- Skia adapter code which needs to convert them back to SkRSXform when
using the Skia backend
- dl_rendering_tests which is waiting for a major conversion effort
- ?Fuchsia? code has an SkCanvas spy adapter used in its embedder code
(not DisplayList related)
- web_ui/skwasm
2025-01-15 19:08:38 +00:00
Jason Simmons
1e79b65ea1
Manual roll of Skia to e7b8d078851f (#161609)
The Skia->engine roller was disabled for a few weeks during the
migration to the monorepo.
2025-01-15 15:14:23 +00:00
Jonah Williams
b515f829af
[Impeller] null check device buffer in image encoding. (#161194)
Fixes https://github.com/flutter/flutter/issues/160652
2025-01-15 00:34:53 +00:00
Harry Terkelsen
e5b1ab040e
[canvaskit] Fix GIF decode failure (#161536)
Fixes an error when decoding GIFs to check if they are animated. The
decoder needs to be more resilient in the face of Special Purpose blocks
that are in the stream in places not specified in the GIF89a spec.

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

## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-14 21:07:19 +00:00
Michael Goderbauer
3da003c45e
Last Engine<>Framework lint sync (#161560)
This is the last time we have to do this because in
https://github.com/flutter/flutter/pull/161554 I am refactoring the
engine's analysis_options.yaml to just import the one from the root of
the repository. When that lands, lints only have to be enabled in one
place to apply across framework and engine.

Before we can do that we have to do one last sync to make sure the
engine code base is ready. This PR implements that last sync and fixing
all lints that came up.
2025-01-14 20:51:42 +00:00
Michael Goderbauer
9cab4ffee1
Use wildcards (#161548)
https://dart.dev/language/pattern-types#wildcard
2025-01-14 05:13:41 +00:00
Matan Lurey
d102e1197e
Remove references to cirrus, mostly in doc comments. (#161529)
Towards https://github.com/flutter/flutter/issues/161387.
2025-01-13 23:49:04 +00:00
Yegor
0d906f5ecf
[web:a11y] treat empty tappables as buttons (#161360)
The situation will improve even further when we have proper ARIA roles,
but for now if a node is a leaf node and has a tap action, present it to
semantics as a button even if the `isButton` flag is missing.

Fixes https://github.com/flutter/flutter/issues/157743
2025-01-13 23:47:58 +00:00
chunhtai
6b8b57913d
add semantics role and tab (#161260)
fixes https://github.com/flutter/flutter/issues/157134

## 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], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-11 00:08:55 +00:00
Jackson Gardner
1e9202e1ee
Normalize the translation column of the color matrix. (#161109)
`dart:ui` specifies that the translation column of the color matrix
should be in the range 0..255. Skia expects a normalized range between 0
and 1. Skwasm was not normalizing this before passing it to Skia, but
CanvasKit was. After writing a unit test, it appears that the HTML
renderer has the same problem, so I also fixed that as well.

This addresses https://github.com/flutter/flutter/issues/159697
2025-01-08 20:39:21 +00:00
Jackson Gardner
bb4628e0f0
Scale any clip path by 1 / DPR. (#161190)
When applying a clip path, we need to scale it by the DPR in order for
it to be placed and sized correctly.

This addresses https://github.com/flutter/flutter/issues/157603
2025-01-07 16:41:27 +00:00
Matan Lurey
5a23a2a3c4
Remove now-unnecessary command felt analyze. (#160986)
Closes https://github.com/flutter/flutter/issues/154143.

The entire engine sub-repo is now checked for Dart analysis issues, so a
separate command is not needed.
2025-01-06 21:43:47 +00:00
Devon Carew
f00de04113
update repo to be forward compatible with shelf_web_socket v3.0 (#161101)
- update the engine and flutter_tools to be forward compatible with the
upcoming shelf_web_socket v3.0

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

- https://github.com/dart-lang/shelf/issues/457
- https://github.com/dart-lang/shelf/pull/463

## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-06 19:51:49 +00:00
Matan Lurey
5aa179eb04
Remove the word normalized, remove minimum/maximum. (#161106)
Post-submit feedback from
https://github.com/flutter/flutter/pull/160798#pullrequestreview-2527860035.
2025-01-06 19:51:12 +00:00
Matan Lurey
840ef1cac8
Update docs on Color to be more clear about normalized channel values. (#160798)
Closes https://github.com/flutter/flutter/issues/160592.

~Made a few other tiny non-breaking refactors, for example changing
`withValues` internally.~
2024-12-27 22:17:01 +00:00
Mouad Debbar
8731c396a7
[web] Make FLUTTER_WEB_AUTO_DETECT false by default (#160191)
Now that "auto" is not supported anymore, it makes more sense to make
this dart define false by default. And there's no need to pass
`FLUTTER_WEB_AUTO_DETECT=false` anymore.
2024-12-27 20:56:25 +00:00
Jackson Gardner
cb40d94055
Remove dependency on web_tests/artifacts. (#160700)
We no longer pass `web_tests/artifacts` via CAS, so we need to remove it
as a dependency.
2024-12-22 03:20:53 +00:00
Jonah Williams
cec8f1035e
[Impeller] remove unused BliPass::EncodeCommands arg and cleanup. (#160623)
The TransientsAllocator argument to BlitPass::EncodeCommands is
completely unused. Delete it (and add a missing IFDEF around the GLES
debug labels.).
2024-12-20 18:02:17 +00:00
Jackson Gardner
d363fdc31b
Split build and test builders for web engine (#160550)
This splits the web engine into a build phase and a test phase. This
requires a few changes:
* Modify the `generate_builder_json.dart` command to produce two
separate json builder files, `linux_web_engine_build.json` and
`linux_web_engine_test.json`. The former is left as the existing builder
with `release_build: true` (which will run in the merge queue) and the
latter is added as a new builder that runs in the second CI phase.
* Change the `copy_artifacts_step.dart` to pull built artifacts from the
GCS bucket when on LUCI, instead of relying on the CAS bucket. This is
necessary to do the tests separately from the build.
* Move the `felt test --copy-artifacts` command from the build steps to
the test steps, since the test steps themselves need to pull from GCS
instead of relying on the artifacts being populated by CAS.
2024-12-19 22:58:29 +00:00
Michael Goderbauer
8e0993eda8
Auto-format Dart code in engine (#160576)
This auto-formats all *.dart files in the `engine` subdirectory and
enforces that these files stay formatted with a presubmit check.
2024-12-19 17:13:07 +00:00
Yegor
b79ee9282c
[tech debt] remove web engine windows build (#160573)
It takes 30 minutes while all other bots are done in 10-20 minutes. The
old Windows build used to test in IE11 and old Edge. Since we stopped
testing on those we switched to Chromium, but that doesn't provide any
extra signal in addition to what we get from Linux Chromium already.
2024-12-19 06:56:38 +00:00
Mouad Debbar
d2a5b9dcb1 [web] Reland: (Add crossOrigin property to <img> tag used for decoding)++ (flutter/engine#57228)
Relands https://github.com/flutter/engine/pull/54961 with a few more changes and tests.

Fixes https://github.com/flutter/flutter/issues/160127
2024-12-17 15:35:17 +00:00
Mouad Debbar
262b472592 [web] Don't close image source too early (flutter/engine#57200)
A `CkImage` instance holds a reference to `ImageSource?`. When that `CkImage` gets cloned, the `ImageSource` instance becomes shared between the original `CkImage` and its new clone. Then when one of the `CkImage`s gets disposed of, it closes the shared `ImageSource` leaving other live `CkImage`s holding on to a closed `ImageSource`.

The quick solution to this is to have a ref count on the `ImageSource` to count how many `CkImage`s are referencing it. The `ImageSource` will only be closed if its ref count reaches 0.

Fixes https://github.com/flutter/flutter/issues/160199
Fixes https://github.com/flutter/flutter/issues/158093
2024-12-16 19:10:17 +00:00
Michael Goderbauer
b38bf972ae Adjust some ignores for 'dart format' (flutter/engine#57208)
When running `dart format` over these lines the `// ignore` ended up on a line where it wasn't properly ignoring the lint. This adjusts the placement of `// ignore`s so they will continue to ignore the right thing even after the code is auto formatted.

I am hoping that if we do this now the large PR that formats the entire repo will go in smoother without manual intervention.
2024-12-14 02:09:06 +00:00
Jason Simmons
e0263d4132 [skwasm] Fix implementation of SkwasmPath.relativeLineTo (flutter/engine#57201)
Fixes https://github.com/flutter/flutter/issues/157161
2024-12-13 23:35:13 +00:00
Yegor
f344c4699a [web] allow imports to line-break (flutter/engine#57170)
We are about to `dart format` all the Dart code in the repo, which line-breaks some of our imports.

This PR updates `sdk_rewriter.dart` to support line-broken imports.
2024-12-13 20:42:30 +00:00
Jim Graham
9976e07414 Normalize round rect bounds when coming from Flutter (flutter/engine#57171)
A flaw in https://github.com/flutter/engine/pull/57153 - SkRRect would normalize the rect (make it right-side up), a feature that Flutter code takes advantage of. We need to do that manually when we ingest a round rect from Flutter.
2024-12-13 01:14:02 +00:00
gaaclarke
3d8fc3c652 removed c style casts and enabled the lint (flutter/engine#57162)
test exempt: should have no functional change

## 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/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/engine/blob/main/docs/testing/Testing-the-engine.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
2024-12-12 15:33:37 -08:00
Jonah Williams
fda902f593 [Impeller] exploit perfect hash for SamplerDescriptor. (flutter/engine#57036)
There are only 3 or 4 sampler's active at any given time in a flutter app. rather than store them in a hashmap, just use a vector.
2024-12-12 22:00:17 +00:00
Jim Graham
9af7a2a64d Migrate layers and layer_tree to DisplayList/Impeller geometry classes (flutter/engine#57153)
Migrates Layers and LayerTree and parts of the `flow/` utility classes to use DlGeometry (Impeller) classes.
2024-12-12 19:30:55 +00:00
Mouad Debbar
1a1503b867 [web] Use CanvasKit to run tests under engine/ (flutter/engine#54786)
Let's start running the tests under `engine/` using the CanvasKit renderer instead of HTML.

This PR also:
- Moves several tests from `engine/` to `html/` since they were testing html-specific stuff.
- Deletes `test/canvaskit/semantics_test.dart` since it's just an "alias" for `test/engine/semantics/semantics_test.dart`.
2024-12-12 18:57:04 +00:00
gaaclarke
6aeeb645df Removed heap allocations for conical, radial and sweep gradients (flutter/engine#57143)
fixes https://github.com/flutter/flutter/issues/154650

## 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/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/engine/blob/main/docs/testing/Testing-the-engine.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
2024-12-11 15:45:13 -08:00
Jason Simmons
381cd71316 Make Felt unzip Chrome into a temporary directory next to the final location of the files (flutter/engine#57109)
The Web Felt script downloads a Chrome zip archive, extracts it to a temporary directory, and then moves the files to a location expected by the script.

Previously Felt used a temporary directory based on io.Directory.systemTemp.  This may not work because the FileSystemEntity.rename operation used to move the files can fail if the system temp directory is located in a different filesystem from the destination directory.
2024-12-11 21:28:16 +00:00
gaaclarke
17b5cbe28d Removed linear gradient heap allocation for color conversions between dart and display list (flutter/engine#57108)
issue: https://github.com/flutter/flutter/issues/154650

## 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/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/engine/blob/main/docs/testing/Testing-the-engine.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
2024-12-11 09:32:04 -08:00
Jason Simmons
03acf8c635 Dispose pictures created in HtmlViewEmbedder.submitFrame (flutter/engine#57102)
See https://github.com/flutter/flutter/issues/153678
2024-12-11 17:14:14 +00:00
Jonah Williams
e263222f14 [Impeller] reland: switch Pipeline to use raw ptr instead of shared ptr for recorded references. (flutter/engine#57086)
Prev: https://github.com/flutter/engine/pull/57015

There is a unit test that is clearing out the pipeline storage, manually null out captured PipelineRef.
2024-12-10 21:18:46 +00:00
gaaclarke
33306239b4 Revert "[Impeller] switch Pipeline to use raw ptr instead of shared ptr for recorded references." (flutter/engine#57079)
Reverts flutter/engine#57015
fixes https://github.com/flutter/flutter/issues/160004
2024-12-09 17:30:26 -08:00
Jonah Williams
81d3d7fbca [Impeller] switch Pipeline to use raw ptr instead of shared ptr for recorded references. (flutter/engine#57015)
Fixes https://github.com/flutter/flutter/issues/159566

We don't need recorded commands to keep pipelines alive as the context does that already.
2024-12-09 20:42:03 +00:00
Brandon DeRosier
83d36af187 Cover offset+bounds wrapping in the APNG frame region check. (flutter/engine#57025)
The `offset + bounds` calculation in the bounds checks could wrap around, bypassing the check.

(Follow up to https://github.com/flutter/engine/pull/56928)
2024-12-06 23:26:31 +00:00
Michael Goderbauer
75f9549553 Bump Dart SDK to 3.7 (flutter/engine#56989) 2024-12-06 01:41:03 +00:00
Jonah Williams
2e80dbea2c [Impeller] create a 300 es variant of all GLES shaders to support UBO binding. (flutter/engine#56960)
Create a GLES3 "backend" by compiling a second set of GLES shaders to 300 es. This allows the usage of UBOs and SSBOs.
2024-12-05 20:56:16 +00:00
Mouad Debbar
a3ed100995 [web] Use eventTarget when computing pointer offset (flutter/engine#56949)
These changes are mainly things I missed in https://github.com/flutter/engine/pull/56719

Fixes https://github.com/flutter/flutter/issues/159804
2024-12-05 18:07:20 +00:00
Brandon DeRosier
ba21393f49 Drop APNG frames that don't fit entirely within the destination surface. (flutter/engine#56928)
As per the [spec](https://www.w3.org/TR/png/#fcTL-chunk):

> The frame must be rendered within the region defined by x_offset, y_offset, width, and height. This region may not fall outside of the default image; thus x_offset plus width must not be greater than the [IHDR](https://www.w3.org/TR/png/#11IHDR) width; similarly y_offset plus height must not be greater than the [IHDR](https://www.w3.org/TR/png/#11IHDR) height.
2024-12-05 09:34:32 +00:00
Jonah Williams
7b1b6d13f2 [Impeller] store GLES bindings on render pass w/ offsets instead of per-command. (flutter/engine#56910)
To reduce heap fragmentation from tons of little vectors.
2024-12-05 06:13:30 +00:00
Jonah Williams
240ce64b1f [Impeller] avoid heap allocation in RenderTarget object. (flutter/engine#56829)
All render targets created by flutter have a single color attachment. Lets specialize that case in impeller::RenderTarget by creating a field for that attachment description instead of placing it in a hashmap.
2024-12-04 17:28:13 +00:00
LongCatIsLooong
18cf7ae0a7 Reland "[iOS] Full keyboard access scrolling (#56606)" (flutter/engine#56842)
Reverts flutter/engine#56802

https://github.com/flutter/flutter/pull/159517 should address the engine roll failure.

I'm not planning to land this until the coming Monday.
2024-12-02 21:53:21 +00:00
Jonah Williams
e8c3eefb21 [Impeller] dont use dynamic shader metadata path for precompiled shaders. (flutter/engine#56827)
Should fix https://github.com/flutter/flutter/issues/159520 ~~but I still need to check locally.~~ Seems to do the trick.

All cmd bindings were copying the shader metadata, which meant allocating/de-allocating a lot of strings per draw.
2024-11-27 17:21:09 +00:00
Jim Graham
2a55c9edd8 [DisplayList] migrate DlColorFilter objects to new source layout (flutter/engine#56785)
A new source code/header structure was introduced when the DlColorSource and DlImageFilter objects were migrated to Impeller geometry classes. Even though the DlColorFilter objects did not depend on Skia geometry objects, they need to be updated to the new source layout for consistency.
2024-11-26 20:48:20 +00:00
auto-submit[bot]
57b102520b Reverts "[iOS] Full keyboard access scrolling (#56606)" (flutter/engine#56802)
Reverts: flutter/engine#56606
Initiated by: LongCatIsLooong
Reason for reverting: https://github.com/flutter/flutter/issues/159456
Original PR Author: LongCatIsLooong

Reviewed By: {chunhtai, cbracken}

This change reverts the following previous change:
This PR adds basic FKA scrolling support: when the iOS focus (the focus state is maintained separately from the framework focus, see the previous PR) switches to an item in a scrollable container that is too close to the edge of the viewport, the container will scroll to make sure the next item is visible. 

Previous PR for context: https://github.com/flutter/engine/pull/55964

https://github.com/user-attachments/assets/84ae5153-f955-4d23-9901-ce942c0e98ac

### Why the UIScrollView subclass in the focus hierarchy

The iOS focus system does not provide an API that allows apps to notify it of focus highlight changes. So if we were to keep using the transforms sent by the framework as-is and not introducing any UIViews in the focus hierarchy, the focus highlight will be positioned at the wrong location after scrolling (via FKA or via framework). That does not seem to be part of the public API and the focus system seems to only know how to properly highlight focusable UIViews.

### Things that currently may not work

1. Nested scroll views (have not tried to verify) 

The `UIScrollView`s are always subviews of the `FlutterView`. If there are nested scrollables the focus system may not be able to properly determine the focus hierarchy (in theory the iOS focus system should never depend on `UIView.parentView` but I haven't tried to verify that).

2. If the next item is too far below the bottom of the screen and there is a tab bar with focusable items, the focus will be transferred to tab bar instead of the next item in the list

Video demo (as you can see the scrolling is really finicky):

https://github.com/user-attachments/assets/51c2bfe4-d7b3-4614-aa49-4256214f8978

I've tried doing the same thing using a `UITableView` with similar configurations but it seems to have the same problem. I'll try to dig a bit deeper into this and see if there's a workaround.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-26 00:39:15 +00:00
LongCatIsLooong
8a1d4c0a08 [iOS] Full keyboard access scrolling (flutter/engine#56606)
This PR adds basic FKA scrolling support: when the iOS focus (the focus state is maintained separately from the framework focus, see the previous PR) switches to an item in a scrollable container that is too close to the edge of the viewport, the container will scroll to make sure the next item is visible. 

Previous PR for context: https://github.com/flutter/engine/pull/55964

https://github.com/user-attachments/assets/84ae5153-f955-4d23-9901-ce942c0e98ac

### Why the UIScrollView subclass in the focus hierarchy

The iOS focus system does not provide an API that allows apps to notify it of focus highlight changes. So if we were to keep using the transforms sent by the framework as-is and not introducing any UIViews in the focus hierarchy, the focus highlight will be positioned at the wrong location after scrolling (via FKA or via framework). That does not seem to be part of the public API and the focus system seems to only know how to properly highlight focusable UIViews.

### Things that currently may not work

1. Nested scroll views (have not tried to verify) 

The `UIScrollView`s are always subviews of the `FlutterView`. If there are nested scrollables the focus system may not be able to properly determine the focus hierarchy (in theory the iOS focus system should never depend on `UIView.parentView` but I haven't tried to verify that).

2. If the next item is too far below the bottom of the screen and there is a tab bar with focusable items, the focus will be transferred to tab bar instead of the next item in the list

Video demo (as you can see the scrolling is really finicky):

https://github.com/user-attachments/assets/51c2bfe4-d7b3-4614-aa49-4256214f8978

I've tried doing the same thing using a `UITableView` with similar configurations but it seems to have the same problem. I'll try to dig a bit deeper into this and see if there's a workaround.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-25 21:05:18 +00:00