1756 Commits

Author SHA1 Message Date
Jonah Williams
408cbaf233
[Impeller] ensure that OpenGL "flipped" textures do not leak via texture readback. (#163501)
Fixes https://github.com/flutter/flutter/issues/163315
Fixes https://github.com/flutter/flutter/issues/163521
Fixes https://github.com/flutter/flutter/issues/142641

OpenGL has an inverted coordinate system (bottom left is zero) compared
to Metal/Vulkan (top left is zero). We handle this by rendering things
upside down on OpenGL. Unfortunately this can leak out of the renderer
via readback (toImage), so we need to make sure to undo the inversion.

This is not performed for the "TextureCoordinateSystem::kUploadFromHost"
state as that indicates the texture is already "right side up".
2025-02-19 20:07:07 +00:00
gaaclarke
f949d8eaed
Tweaked TextContents math to avoid floating point errors (#162480)
This gets rid of artifacts in characters.

## before

![before_445](https://github.com/user-attachments/assets/c66d3d22-baaf-4d66-bff3-3ad5b4d5747c)

## after

![after_445](https://github.com/user-attachments/assets/0e23a593-b68a-4334-a82e-4f7dc1ecdc17)


## 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-02-14 17:21:30 +00:00
gaaclarke
58bc9643b5
[Impeller] rrect_blur: scale max radius clamp by transform (#161238)
migrated PR https://github.com/flutter/engine/pull/54350

## 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-02-10 19:23:16 +00:00
AthulJoseph
f6b0598945
Added support to set viewport (#162602)
Resolves #157201.
2025-02-06 19:07:01 +00:00
Michael Goderbauer
c783ce2344
Remove outdated ignores (#162773)
Powered by the new and amazing `unnecessary_ignore` lint.

We're not enabling this lint by default because being able to
temporarily use ignores that don't ignore anything is a powerful tool to
enable migrations. We should turn this lint on locally periodically,
though, and clean up all outdated ignores.
2025-02-06 18:40:25 +00:00
Yegor
1f5cb0d665
support running et fetch from anywhere (#162712)
Support running `et fetch` from any directory.
2025-02-06 04:59:24 +00:00
Brandon DeRosier
039d0db698
[Flutter GPU] Breaking: Use exceptions for resource creation errors. (#162104)
Resolves https://github.com/flutter/flutter/issues/143891.

This patch includes breaking changes, but this API is still in preview.
* Breaking: Rename `Texture.GetBaseMipLevelSizeInBytes` to
`Texture.getBaseMipLevelSizeInBytes`.
* Breaking: Make `Texture.overwrite` throw exception instead of
returning false.
* Non-breaking: Make `DeviceBuffer`/`Texture` creation throw exceptions
instead of returning nullables.

We can incrementally add more specific exceptions for resource creation
failure.
2025-02-01 01:46:34 +00:00
Jim Graham
e6185c3471
[Impeller] Avoid NaN values when setting up for the fast squircle blur shader (#162421)
Fixes https://github.com/flutter/flutter/issues/162128

Zero dimensioned rectangle blurs were causing the setup code to generate
NaN values. This condition could also happen for some very thin or short
rectangles so rather than just rule out zero-dimensioned rectangles, the
uniforms are checked for NaN values and the operation is skipped in
those cases.
2025-01-30 03:26:14 +00:00
Matan Lurey
9e273d5e6e
Remove scenario_app/android and rename to ios_scenario_app. (#160992)
🚫 **BLOCKED** : Do not merge until
https://github.com/flutter/flutter/issues/161261 (additional test
coverage).

---

This PR eliminates (1) `scenario_app/android`, and all references to an
Android `scenario_app`, including documentation, CI configuration, build
rules, test runner, Android-side test application, and (2), to verify
and disambiguate the remains, renames the folder `ios_scenario_app`,
which is now accurate.

It also eliminates elements that were _only_ used in the Android-side
scenario_app, such as Firebase Test Lab uploading.

I would be open to doing this in phases if we thought it was better to
do so, but given its mostly a mechanical change (and by renaming the
directory, references can be checked merely by looking for
`/\bscenario_app/`, I believe this is safe to iterate on and eventually
merge after the holidays.

## Background

As of the merged mono-repo, there is no longer a requirement for the
engine to be testable as a standalone unit.

As an example,
[`%ENGINE%/testing/scenario_app`](3762f2e973/engine/src/flutter/testing/scenario_app),
which was intended to _emulate_ the Flutter framework (and some of
`flutter_tools` tooling), load the iOS and Android embedder, and run
various "scenarios" (which ran a combination of `dart:ui` code and
Android Java/iOS Obj-C) verifying golden-file screenshots.

Instead, it is now possible to write and run _real_ (full) Flutter apps
the same way that an end-user (or our own tests) would. One such example
is
[`dev/native_driver_test`](https://github.com/flutter/flutter/tree/master/dev/integration_tests/native_driver_test),
which is a full-fledged Flutter app, which uses standard tooling (i.e.
`flutter`), to test most of the same elements that previously were only
tested in the Android version of `scenario_app`.
2025-01-28 03:43:46 +00:00
Chinmay Garde
cd586eea50
[DisplayList] Move nested canvas enums into their own TU. (#162037)
These cause ambiguous compiler reference errors on some GCC versions.
And, the errors seem right. But, newer versions of clang seem to resolve
that ambiguity by also checking if the references to the types are also
references to identical types.

Per the chat with Jim, also added the Dl prefix to those types.

No change in functionality. Just a rename of the types and removal of
the now unnecessary typedefs.
2025-01-27 22:00:01 +00:00
Jonah Williams
b82e9022a3
[Impeller] Skip clip entity replay that cannot impact current clip. (#162113)
Fixes https://github.com/flutter/flutter/issues/161262

Sometimes we end up with clip replay entities that have clip depth
values substantially below the current depth. I suspect this is due to
either mismatched save/restore or a bug in our code. Update: this isn't
a bug/bug but its definitely a bug. We can have multiple clips per save,
but the restore will remove at most one from the record/replay.


If a clip has a depth value that is less than the current clip depth, it
cannot by definition impact anything that draws after it.
2025-01-24 19:49:40 +00:00
Jason Simmons
6a8d77dccd
[Impeller] Implement inherited opacity for ColorFilterContents (#161834)
Inherited opacity should be combined with the alpha of the
ColorFilterContents when drawing objects with filters inside an opacity
layer.
2025-01-23 15:45:55 +00:00
Koji Wakamiya
2919003513
fix: Call codec.dispose in tests of engine/src/flutter (#161115)
PR derived from https://github.com/flutter/flutter/pull/159945.

Added `codec.dispose()` for directories under `engine/src/flutter`.

## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] 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-23 15:13:57 +00:00
Jonah Williams
948e31d19f
[Impeller] adjust coverage origin when rounding out SaveLayer bounds. (#161838)
Fixes https://github.com/flutter/flutter/issues/161374

When we round out the texture size for a saveLayer, also round out the
coverage so that the drawing origin is correct. Otherwise we may
actually cut off the top left edge of rendering.

---------

Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>
2025-01-23 00:44:54 +00:00
Matan Lurey
dc42bcf2ec
Make font-subset a standalone run_tests.py variant. (#162016)
Closes https://github.com/flutter/flutter/issues/161538.
2025-01-22 19:12:56 +00:00
Jonah Williams
12518fac13
[Impellerc] correctly pad arrays of vec3s in reflector. (#161697)
When processing the metadata for a struct with an array, incorporate the
padding into the layout. Previously we would register a vec3[n] array as
being 4*n bytes (including the padding), but when uploading this would
result in us writing data into the padding and then leave the rest
uninitialized. now we correctly insert a padding element between 3 byte
elements.

Fixes https://github.com/flutter/flutter/issues/161645
2025-01-17 00:48:01 +00:00
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
gaaclarke
e683e1031c
Added special case for fat width arcs (#161255)
fixes https://github.com/flutter/flutter/issues/158567

This draws arcs as oval sectors when the stroke width is large enough.

## 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 16:55:30 +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
Matan Lurey
1d38029c3b
Copy linux_host_engine as linux_host_engine_test, removing archives: [...]. (#161532)
Towards https://github.com/flutter/flutter/issues/161406.

The goal is to, assuming this is WAI, move the `bringup: true` build
(the newly created one) to presubmit, and then in a follow-up PR, remove
the `tests: [...]` (and test dependencies) from
`linux_host_engine.json`, meaning that it would be a build/archive only
builder, and this _new_ builder would be a build/test one.

We talked about it being hypothetically better to _not_ build the engine
multiple times, and decided for now to depend on RBE and not try to
create stages or download artifacts created from another builder, but if
@zanderso has another suggestion here is the place to chime in :)

(Btw if we like this approach, I'll create a task list of every builder
that needs to be migrated)
2025-01-13 23:45:41 +00:00
Matan Lurey
1d79946ecb
Remove last two references to Cirrus CI. (#161530)
Towards https://github.com/flutter/flutter/issues/161387.
2025-01-13 23:44:40 +00:00
Matan Lurey
e3b301f23d
Stamp golden files to verify engine Skia Gold is WAI. (#161240)
Auto-generated by `dart testing/skia_gold_client/tool/generate.dart`.

This is just to make sure that everything is working after the recent
configuration.
2025-01-07 18:23:39 +00:00
Matan Lurey
e66e04f39f
Remove verbose: true from canvas_test.dart. (#161211)
General cleanup after https://github.com/flutter/flutter/issues/157206.
2025-01-07 16:23:52 +00:00
Matan Lurey
cda3515126
Use flutter repo for engine golds instead of flutter-engine. (#160556)
Closes https://github.com/flutter/flutter/issues/157206.

I also added a `prefix` that will default to `engine.` to avoid
accidentally stomping on golden names across repos.

/cc @gaaclarke for visibility, @Piinks for visibility.

(I would love to get rid of this "engine copy" of the client as part of
longer-term mono repo deduplication).
2025-01-07 03:37:36 +00:00
Matan Lurey
95c1bc1c3e
[Engine] Make SkiaGoldClient a NOP when the branch is not main or master. (#161187)
Unblocks https://github.com/flutter/flutter/pull/160556.

Currently the merge queue runs in post-submit mode, which looks for (and
fails to find) digests for PRs that have not yet been submitted,
blocking the engine goldens from being enabled/checked in
https://github.com/flutter/flutter/pull/160556. This PR is a proposal to
fix that by skipping the tests.

We might decide instead that tests should not be running in the merge
queue at all, in which case we will _not_ merge this PR and will change
how the merge queue works instead. Otherwise this PR is a proof of
concept of [aligning implementations with the
framework](a9b3f6c042/packages/flutter_goldens/lib/flutter_goldens.dart (L338)).
2025-01-07 01:38:52 +00:00
Jim Graham
a513498487
[DisplayList] Migrate DlVertices onto Impeller/DisplayList geometry classes (#160633)
DlVertices was already half migrated onto the DL geometry classes, this
completes the conversion.
2024-12-20 07:01:52 +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
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
Tess Strickland
ee9024da88 Add entry-point annotations for test-only code. (flutter/engine#57158)
This change adds entry-point annotations to methods and classes accessed
by native code during engine tests. Currently, entry point annotations
are not checked by the Dart VM when running in JIT mode, only in AOT
mode. In order to also enforce entry point annotations in JIT mode,
first tests in Flutter must be appropriately annotated to avoid roll
failures.

Related issues:
* https://github.com/flutter/flutter/issues/118608
* https://github.com/dart-lang/sdk/issues/50649
2024-12-13 16:22:17 +01: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
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
Robert Ancell
fd12f3489c Remove LSAN supressions for Linux embedder (flutter/engine#56913)
Fixes https://github.com/flutter/flutter/issues/90155
2024-12-05 11:44:08 +13: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
Jim Graham
0c245ce56b [DisplayList] Delete (publicly) unused DlColorColorSource (flutter/engine#56825)
While recently updating the DlColorSource sources I noticed some questionably implementation choices in the Color variant of the color sources.

I then realized that there was no public use of these classes (other than mostly their own unit tests) and so they should be deleted to focus on implementing the variants that are actually used by Flutter.
2024-11-27 00:13:22 +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
Jonah Williams
8aabbdf368 [Impeller] delete Impeller sim opt out. (flutter/engine#56706)
Impeller only on simulators.
2024-11-22 21:10:00 +00:00
Jim Graham
dee413e427 [DisplayList] migrate DlColorSource objects to Impeller geometry (flutter/engine#56735)
The DlColorSource code uses Skia geometry classes for its internal computations. This PR switches those implementations to use the Impeller geometry classes for consistency and 3rd party header file independence.
2024-11-22 20:30:21 +00:00
Chinmay Garde
daa09b9a64 [Impeller] Run simulator tests with Impeller enabled. (flutter/engine#56740)
The Info.plist override was missed earlier.

The main changes to the tests are due to the UI thread merge with the platform thread. The amendment to the "spawn" API are due to the fact that the assertions checked for the presence of GrDirectContext which will never exist with Impeller.

Unblocks https://github.com/flutter/engine/pull/56706
2024-11-21 23:48:59 +00:00
Daco Harkes
09e3b52bdf [native assets] Consume NativeAssetsManifest.json (flutter/engine#56727)
This PR introduces a `NativeAssetsManifest.json` next to the `AssetManifest.json` and `FontManifest.json`. This removes the need for embedding the native assets mapping inside the kernel file and will enable decoupling native assets building and bundling from the kernel compilation in flutter tools. This will then allow us to remove dry-run from the build hook protocol.

(It also means all isolate groups will have the same native assets. However, since Flutter does not support `Isolate.spawnUri` from kernel files anyways, this is not a regression.)

This manifest is parsed eagerly on startup by the engine in a manner similar to how the font manifest is parsed. The manifest contents need to be available in the callback for resolving assets, which does not have access to the engine. Therefore the parsed manifest is `NativeAssetsManager` stored in the `IsolateGroupData`. The engine passes it in on isolate group creation, and the FFI callbacks access it from the isolate group data.

Issue:

* https://github.com/flutter/flutter/issues/154425

Related PRs:

* https://dart-review.googlesource.com/c/sdk/+/388161

Follow up work:

* This PR does not yet remove the engine callbacks registered via the dart_api that rely on kernel embedding. If we were to do that in this PR, it would require a manual roll of the engine into flutter/flutter with the PR that switches flutter_tools to emit the native assets manifest instead of embedding in kernel, and a manual roll into g3 to switch emitting a manifest instead of embedding in kernel. A TODO is left in the code for those callbacks to be removed.

## Testing

Most of this PR cannot be tested in isolation. The code in this PR is heavily exercised in the follow up flutter_tools PR which creates the `NativeAssetsManifest.json` and removes the embedding of native assets in kernel files.

* This PR adds a unit test for parsing the JSON manifest.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-21 18:01:46 +00:00
AthulJoseph
4705535548 [Flutter GPU] Added support to set Scissor. (flutter/engine#56302)
Added support to set scissors. This resolves issue #157199
2024-11-21 05:52:54 +00:00
Jim Graham
e3d616ca84 [DisplayList] migrate DlImageFilter code to Impeller geometry classes (flutter/engine#56720)
The DlImageFilter code uses Skia geometry classes for its internal computations. This PR switches those implementations to use the Impeller geometry classes for consistency and 3rd party header file independence.
2024-11-20 20:47:37 +00:00
Chris Bracken
1a60defc96 TestMetalContext: Use ARC-managed Metal types (flutter/engine#56717)
Previously, we could not include any Objective-C types in test_metal_context.h, since that file was transitively included in pure C++ translation units. All users have been refactored into backend-specific files, and all Metal-related files are Objective-C++ files.

We now use Metal types directly in the header, without the workarounds.

Issue: https://github.com/flutter/flutter/issues/158998
Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-19 22:50:10 +00:00
Michael Ludwig
c0e6c19e09 Remove SK_USE_LEGACY_BLUR_RASTER staging flag (flutter/engine#56618)
Also updates the image_filter_test.dart expected color values for a blur unit test. The legacy blur algorithm would a) treat very small blur sigmas as the identity even though the effect was still perceptible and b) was very inaccurate for sigmas < 2.  The unit test used a sigma of 1.0 so fell within the inaccurate range but the expected values appear to have been taken directly from the original Skia output.  This updates them to match the output of the new algorithm (which is also more consistent between CPU and GPU).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-19 02:28:26 +00:00
Chris Bracken
6226520c45 Extract TestGLContext to separate translation unit (flutter/engine#56647)
For consistency with the Test.*Context classes for other backends, which live in their own implementation file with their own header, extract TestEGLContext to its own header and TU so that in cases where only a TestEGLContext is required (e.g. EmbedderTestBackingStoreProducerGL), we don't need to include all the various test GL surface classes as well.

GetEGLError is used by both TestEGLContext and the TestGLSurface classes, so moves to its own utils file.

No tests because this is a refactoring with no semantic changes, and the code itself is test code.

Issue: https://github.com/flutter/flutter/issues/158998

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 21:56:05 +00:00
Chris Bracken
bcbcb6631e iOS,macOS: Enable ARC in flutter_cflags_objc[c] (flutter/engine#56685)
Enables the `-fobjc-arc` compiler flag for Objective-C and Objective-C++
translation units.

Eliminates the flutter_cflags_objc[c]_arc settings, since they're now
redundant.

All Obj-C/Obj-C++ code in our codebase has now been migrated to ARC.

Issue: https://github.com/flutter/flutter/issues/137801
2024-11-18 13:37:40 -08:00
gaaclarke
9f1adb8ff4 [impeller] enable framebuffer blit when available (flutter/engine#56596)
depends on https://github.com/flutter/engine/pull/56573
fixes https://github.com/flutter/flutter/issues/158523

## 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-11-18 09:54:06 -08:00