1559 Commits

Author SHA1 Message Date
Kaylee Lubick
2e2f3e35cd Update uses of GrVkBackendContext and other deprecated type names (flutter/engine#53491)
As of [this CL](https://skia-review.googlesource.com/c/skia/+/859125),
`GrVkBackendContext` is an alias for `skgpu::VulkanBackendContext`, so
this updates Flutter to use the GPU-backend agnostic version. See
<https://issues.skia.org/issues/309785258>.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-06-24 07:39:16 -04:00
auto-submit[bot]
feefb6ebd8 Reverts "Reland "Upgrade all[most] androidx dependencies to latest" (#53462)" (flutter/engine#53468)
Reverts: flutter/engine#53462
Initiated by: gmackall
Reason for reverting: blocking roll (see https://github.com/flutter/flutter/pull/150465#issuecomment-2177329885).
Original PR Author: gmackall

Reviewed By: {reidbaker}

This change reverts the following previous change:
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-19 01:08:48 +00:00
Gray Mackall
4e98015b1e Reland "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53462)
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-18 21:14:07 +00:00
Jim Graham
7f44004e56 [DisplayList] delete obsolete PathEffect sources (flutter/engine#53441)
As of https://github.com/flutter/engine/pull/53411 there are no more (non-test) references to path effects anywhere in the engine.

Deleting the dead code.
2024-06-18 07:45:01 +00:00
Jim Graham
c9b612ff9a [DisplayList] Create DrawDashedLine for paragraph code (flutter/engine#53411)
With this minor addition to the DlCanvas/DisplayList API the code in the paragraph builder no longer needs to worry about PathEffect objects and their varying support on the backends.

At this point all PathEffect code in the engine is obsolete and can be deleted, but I'll leave that for a follow-on PR.

The only PathEffect related thing I did delete was support for rendering primitives with a PathEffect in the DL Rendering tests, both because it is a vestigial attribute and also because it would interfere with the new DrawDashedLine rendering test (a PathEffect on top of a PathEffect...).
2024-06-17 22:50:20 +00:00
Jonah Williams
6da0384373 [Impeller] move draw vertices to dl unittests. (flutter/engine#53400)
Part of https://github.com/flutter/flutter/issues/142054

Moves all of the drawVertices tests for aiks and entities into DL. This might change some of the entity goldens but ... these are easy to eyeball so it should be fine IMO.
2024-06-17 22:27:04 +00:00
Jonah Williams
0daddbfe73 [Impeller] Move drawAtlas golden tests to display list. (flutter/engine#53398)
Part of https://github.com/flutter/flutter/issues/142054

Moves all of the drawAtlas tests for aiks and entities into DL. This might change some of the entity goldens but ... these are easy to eyeball so it should be fine IMO.
2024-06-17 18:24:56 +00:00
gaaclarke
12ccf1ee1c [Impeller] moved blur to unrotated local space, started respecting respect_ctm flag (flutter/engine#53377)
Resolves https://github.com/flutter/flutter/issues/142014
Resolves https://github.com/flutter/flutter/issues/150114

A previous patch made the blur operate in source space. This doesn't
work for text since it jumbles up the characters. We probably want the
text crisp when scaled anyways so it would make sense not to render
those is source space. Instead I moved the blur to "scaled source space"
or "unrotated local space", if you will.

This is more closely what we had previously but it handles rotation
correctly.

Also, brandon fixed a problem where we weren't minding a flag on how the
ctm should be used when rendering mask blurs. That was important to this
fix too.

## new golden results before patch
<img width="966" alt="Screenshot 2024-06-13 at 3 32 29 PM"
src="https://github.com/flutter/engine/assets/30870216/097ef2d3-26a6-45fc-b1a5-e0b699d31dfd">

<img width="962" alt="Screenshot 2024-06-13 at 3 32 36 PM"
src="https://github.com/flutter/engine/assets/30870216/3b6c03fd-bf88-47eb-a0eb-c362dcaecd63">

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

---------

Co-authored-by: Brandon DeRosier <bdero@google.com>
2024-06-14 15:17:28 -07:00
Victoria Ashworth
ecad29a177 Change element to wait for in AppExtensionTests testAppExtensionLaunching (flutter/engine#53358)
Instead of waiting for the first cell in the share sheet to appear, wait for the first cell matching the predicate to appear. It seems that on macOS 14 it [occasionally doesn't find any matches](https://github.com/flutter/flutter/issues/150117#issuecomment-2163493564), presumably a race condition - so this will wait up to 10 seconds for the desired elements to appear.

Attempting to fix https://github.com/flutter/flutter/issues/150117. I wasn't able to recreate locally and it only happens flakily in CI so hard to guarantee it will fix.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-13 14:39:18 +00:00
Jonah Williams
673ff9c03b [Impeller] Move Gradient tests to display list. (flutter/engine#53345)
Migrate almost all of the gradient unittests to display list. Removes tests for disabled dithering and the dithering flag, as it has not been possible to disable dithering on gradients for months and months.

Part of https://github.com/flutter/flutter/issues/142054
2024-06-13 01:49:57 +00:00
Brandon DeRosier
f6559124a1 [Flutter GPU] Generate DescriptorSetLayouts for pipelines & export symbols on Android. (flutter/engine#53184)
Part of https://github.com/flutter/flutter/issues/145011.

This gets Flutter GPU working on Android.
2024-06-11 11:25:29 -07:00
gaaclarke
5c4ba91e54 [impeller] switches gaussian blur to a "source space" calculation (flutter/engine#53261)
fixes https://github.com/flutter/flutter/issues/149781
fixes https://github.com/flutter/flutter/issues/149458
fixes https://github.com/flutter/flutter/issues/140890

This works by performing the blur in the axis aligned "source space" (as opposed to "global space").  The rotation and scaling then is applied to the result of the gaussian blur.  Previously the differences between rrect_blur and gaussian blur were "fixed" in https://github.com/flutter/engine/pull/53130 which worked for blurring content that had no signal.  This addresses that same problem but in a more correct way that is less prone to artifacts when translating a blur since the blur happens in "source space".

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-08 00:25:25 +00:00
hellohuanlin
6ea5724ca1 Reland "[ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering #53072" (flutter/engine#53256)
The previous PR was reverted because it was on top of an outdated commit prior to ARC. This PR rebases the main. The only change is removing the `[super dealloc]` call that caused the compiler error. 

*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/142813
Fixes https://github.com/flutter/flutter/issues/142830

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-06 22:33:18 +00:00
Brandon DeRosier
70c3469143 [Impeller] Round out extreme angles between curve polyline segments. (flutter/engine#53210)
Resolves https://github.com/flutter/flutter/issues/137956.

Detect when the angle between two curve segments is > 10 degrees and
insert smoothing geometry if so. See [this
comment](https://github.com/flutter/flutter/issues/137956#issuecomment-2148395911)
for the full rationale behind this change.

```dart
    Paint paint = Paint()
      ..color = Colors.white
      ..strokeWidth = 50
      ..strokeCap = StrokeCap.round
      ..strokeJoin = StrokeJoin.round
      ..style = PaintingStyle.stroke;

    Path path = Path();
    path.moveTo(0, 0);
    path.quadraticBezierTo(100, 100, 0, 0);
    canvas.drawPath(path, paint);
```

Before:
<img width="166" alt="image"
src="https://github.com/flutter/engine/assets/919017/bbca80fb-a928-42aa-9e85-ad8e345558de">

After:
<img width="145" alt="image"
src="https://github.com/flutter/engine/assets/919017/aab6ffc8-d03e-4c2f-af83-c125d7acc250">
2024-06-06 15:00:12 -07:00
Jonah Williams
e0c56ae81b [Impeller] Reland Use Skia software renderer to draw stroked text. (flutter/engine#53238)
We need to match the rounding of glyphs to fix https://github.com/flutter/flutter/issues/138670 . We also don't have sufficient AA quality with 4x MSAA for high quality strokes.

Fixes https://github.com/flutter/flutter/issues/138670
Fixes https://github.com/flutter/flutter/issues/136688
2024-06-06 02:16:52 +00:00
auto-submit[bot]
50421b59ad Reverts "[Impeller] Use Skia software renderer to draw stroked text. (#53198)" (flutter/engine#53237)
Reverts: flutter/engine#53198
Initiated by: jonahwilliams
Reason for reverting: oops.
Original PR Author: jonahwilliams

Reviewed By: {chinmaygarde}

This change reverts the following previous change:
We need to match the rounding of glyphs to fix https://github.com/flutter/flutter/issues/138670 . We also don't have sufficient AA quality with 4x MSAA for high quality strokes.

Fixes https://github.com/flutter/flutter/issues/138670
Fixes https://github.com/flutter/flutter/issues/136688
2024-06-06 01:03:29 +00:00
Jonah Williams
ee3a8d0775 [Impeller] Use Skia software renderer to draw stroked text. (flutter/engine#53198)
We need to match the rounding of glyphs to fix https://github.com/flutter/flutter/issues/138670 . We also don't have sufficient AA quality with 4x MSAA for high quality strokes.

Fixes https://github.com/flutter/flutter/issues/138670
Fixes https://github.com/flutter/flutter/issues/136688
2024-06-05 23:54:48 +00:00
Jim Graham
9a169198ec [DisplayList] remove legacy DisplayListMatrixClipTracker (flutter/engine#53232)
The MatrixClipTracker was nothing more than a vector of MatrixClipState objects and a whole lot of duplicate delegation methods. It provided little value since nearly every use of it already had a state stack that was kept in synch with it's internal stack and so it was just adding an extra layer of delegation and extra allocations.
2024-06-05 22:28:15 +00:00
Christopher Fujino
0ed900a541 Update testing/skia_gold_client/README.md (flutter/engine#53233)
Add warning that you must be logged in to triage with skia gold
2024-06-05 21:27:05 +00:00
auto-submit[bot]
4c30aee50a Reverts "[ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering (#53072)" (flutter/engine#53220)
Reverts: flutter/engine#53072
Initiated by: jason-simmons
Reason for reverting: compilation errors on iOS targets

```
FlutterPlatformViews_Internal.mm:277:10: error: ARC forbids explicit message send of 'dealloc'
  277 |   [super dealloc];
      |    ~~~~~ ^
 ```

(see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8746006425774972161/+/u/build_ci_ios_debug_unopt_sim_flutter_testing_scenario_app_flutter_shell_platform_darwin_ios:ios_test_flutter/st
Original PR Author: hellohuanlin

Reviewed By: {cbracken, jonahwilliams}

This change reverts the following previous change:
This PR uses `CAShapeLayer` as the mask to avoid software rendering. 

I kept `UIView` as the mask, so that we can measure just the improvement related to avoiding software rendering. This also allows me to land this change sooner. I created [a separate issue](https://github.com/flutter/flutter/issues/149212) to track removing UIView as the mask. 

Note: the previous behavior seems to be incorrect (or at least not pixel perfect). This PR fixed it. See comments. 

See design doc: https://docs.google.com/document/d/1TqG_N4GK_qctuk73Gk3zOdAiILUrwMqxoCMgroK_AeA/edit?resourcekey=0-jUiidfzIS642ngG2w9vSUA&tab=t.0

*List which issues are fixed by this PR. You must list at least one issue.*

Fixes https://github.com/flutter/flutter/issues/142813
Fixes https://github.com/flutter/flutter/issues/142830

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-05 14:26:47 +00:00
hellohuanlin
d1f28a74ae [ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering (flutter/engine#53072)
This PR uses `CAShapeLayer` as the mask to avoid software rendering. 

I kept `UIView` as the mask, so that we can measure just the improvement related to avoiding software rendering. This also allows me to land this change sooner. I created [a separate issue](https://github.com/flutter/flutter/issues/149212) to track removing UIView as the mask. 

Note: the previous behavior seems to be incorrect (or at least not pixel perfect). This PR fixed it. See comments. 

See design doc: https://docs.google.com/document/d/1TqG_N4GK_qctuk73Gk3zOdAiILUrwMqxoCMgroK_AeA/edit?resourcekey=0-jUiidfzIS642ngG2w9vSUA&tab=t.0

*List which issues are fixed by this PR. You must list at least one issue.*

Fixes https://github.com/flutter/flutter/issues/142813
Fixes https://github.com/flutter/flutter/issues/142830

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-05 02:40:23 +00:00
Jonah Williams
aad95e521e [Impeller] tighten fast gradient condition. (flutter/engine#53195)
If the start/end point are _inside_ the rectangle, we can't apply the fast gradient condition.
2024-06-04 20:15:02 +00:00
Jonah Williams
458cbdd473 [Impeller] Use varying interpolation to compute some linear gradients. (flutter/engine#53166)
Create a fast gradient variant that assumes vertex interpolation is sufficient to compute the gradient color. This follows the approximate design from  https://github.com/flutter/flutter/issues/148651

This is only implemented for draws that are exactly horizontal or vertical gradients on a rectangle with an identity effect transform.  This could be easily extended to all horizontal or vertical gradients by extending the drawGeometry call to make the cover rect customizable. Handling diagonal gradients and effect transforms is more work but feasible.

this is sufficient to make https://github.com/flutter/flutter/issues/148496 about 2x as fast, at least for me. Applications with different gradients will not yet benefit.
2024-06-04 00:28:29 +00:00
gaaclarke
e70587d920 [Impeller] match rrect_blur math to the gaussian math (flutter/engine#53130)
fixes https://github.com/flutter/flutter/issues/149276

## before
<img width="626" alt="Screenshot 2024-05-30 at 1 29 11 PM" src="https://github.com/flutter/engine/assets/30870216/2777d55f-928f-4029-92d3-203e8ca669a0">

## after
<img width="622" alt="Screenshot 2024-05-31 at 11 07 58 AM" src="https://github.com/flutter/engine/assets/30870216/155a592c-90f0-486b-8131-2f66328a871a">

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-03 23:43:55 +00:00
Kaylee Lubick
89547e5ba6 Migrate off deprecated GrVkBackendContext fields (flutter/engine#53122)
Context: https://g-issues.skia.org/issues/309785258

Skia would like to remove these deprecated fields, so this updates
Flutter's use of them to use the new ways.

Note that `VulkanWindow` seems to be unused (or no longer used?) since
there was a mistyped define (`SK_VUKLAN` -> `SK_VULKAN`) causing the
code I am fixing to never be run.

## 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-06-03 14:48:43 -04:00
Jonah Williams
ba76c2f700 [Impeller] Replace Impeller opacity peephole delegate with DL variant. (flutter/engine#52707)
Use the existing DL opacity peephole flags and remove the Impeller variant. Also wires up for experimental canvas.

Work towards https://github.com/flutter/flutter/issues/142054
2024-05-31 22:12:16 +00:00
Jim Graham
2d3cfa1e4c DisplayList SaveLayer (and root layer) read-back flags (flutter/engine#53104)
The DisplayListBuilder now tracks the blend mode(s) used for its contents and whether it contains a child SaveLayer that uses a backdrop filter - both conditions that could require the graphics engine to use a different type of layer to satisfy the requests.

blend modes are tracked as the "highest" blend mode enum used by any content (defaults to kClear) as the enum values tend to be ordered so that larger values will tend to require more complicated render-target accesses.

The root layer of the DisplayList can be queried for both conditions on the root layer using methods on the DisplayList class.
2024-05-30 20:39:10 +00:00
auto-submit[bot]
bc569c90b0 Reverts "[Impeller] enable Impeller by default on Android. (#53099)" (flutter/engine#53125)
Reverts: flutter/engine#53099
Initiated by: jonahwilliams
Reason for reverting: manifest opt out doens't work.
Original PR Author: jonahwilliams

Reviewed By: {bdero, zanderso, chinmaygarde}

This change reverts the following previous change:
All plugin migrations have landed. Enable impeller by default on Android.
2024-05-30 18:15:47 +00:00
Yegor
d3b6b1be14 add SemanticsAction.focus (flutter/engine#53094)
Add `SemanticsAction.focus`. This PR just adds the new enum value without any logic. Adding the enum value first to unblock work that needs to be done on both the engine and framework side that will actually implement all the necessary logic.

This is PR 1 out of ~3 for https://github.com/flutter/flutter/issues/83809
2024-05-30 17:15:53 +00:00
Jonah Williams
ca435f46c9 [Impeller] enable Impeller by default on Android. (flutter/engine#53099)
All plugin migrations have landed. Enable impeller by default on Android.
2024-05-30 01:16:22 +00:00
Michael Goderbauer
c7f659ac91 Switch to FilterQuality.medium for images (flutter/engine#52984)
https://github.com/flutter/flutter/issues/148253
2024-05-29 20:02:17 +00:00
Gray Mackall
dab310ecb8 Manual revert of #53001 (flutter/engine#53075)
Revert label failed due to conflicts

`FlutterFragmentTest.java` was the only file that had merge issues, everything else is the output of `git revert 802e5d2cd3c9e73f336e3fe43487b64a5fdf98d8`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 23:00:20 +00:00
Jonah Williams
eae27f210b [Impeller] make strokes slightly lighter. (flutter/engine#53067)
We can set the minimum stroke width to 0.5 to guarantee at least one hit of 4x MSAA coverage. This doesn't fix stroke fidelity issues but it does make it a bit better.

https://github.com/flutter/flutter/issues/144313
2024-05-28 21:04:21 +00:00
Gray Mackall
802e5d2cd3 Upgrade all[most] androidx dependencies to latest (flutter/engine#53001)
Upgrades every `androidx` dependency in the `src/third_party/android_embedding_dependencies` bundle to the latest version, except the `lifecycle` group*. Tested running a couple of apps as well because when updating these dependencies in the past I've been able to build the engine but then flutter run fail when trying to run an app.

Fixes https://github.com/flutter/flutter/issues/129307, also unblocks a feature that will eventually be needed for Scribe.

[*]`2.8.0` is the latest there, but I ran into an issue with dexing when I tried to upgrade, due to b/336164417, an AGP bug that had its fix backported to all >`8.0.0` versions, but we still support less than that so we will have to wait on that upgrade.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 16:58:59 +00:00
Jonah Williams
c670f5191f [Impeller] Use scaled font to determine bounds, match Skia position rounding behavior, add subpixel X/Y/All/None positioning. (flutter/engine#53042)
Multiple fixes to text rendering that match skia behavior on almost all bugs I've found, except for the glyphs are still _slightly_ too fine for some CJK text. The fixes are:

1. Compute the gylph size in the typographer context, using text size * scale factor text, instead of computing smaller bounds and scaling it up. This was not accurate and as a result we would positon glyphs incorrect by multiple pixels sometimes, causing uneven rows.

2. Match Skia's rounding behavior. previously we were rounding in multiple places, Skia rounds once. This is important to prevent jumping.

3. Use 4 subpixel X positions for rendering. This is the big one that ensures the visible layout matches exactly. Adds support for Y, both, and none positioning too. I couldn't find any examples of just Y or both. Some fonts may specify that have no subpixel positioning. So we don't bother to compute it for those.

Fixes https://github.com/flutter/flutter/issues/138386 / mostly, except slightly not bold enough.
Fixes https://github.com/flutter/flutter/issues/147577 / mostly, except slightly not bold enough.
Fixes https://github.com/flutter/flutter/issues/140475
Fixes https://github.com/flutter/flutter/issues/141467 
Fixes https://github.com/flutter/flutter/issues/135523
Fixes https://github.com/flutter/flutter/issues/127815
2024-05-28 06:08:05 +00:00
LongCatIsLooong
35ca2dd175 Allow unsetting TextStyle.height (flutter/engine#52940)
Introduces a sentinel value `kTextHeightNone` for `ui.TextStyle.height` which can be used to "unset" the current `TextStyle.height` (and for consistency, it applies to `StructStyle.height` and `ParagraphStyle.height` too). Documentation of `TextStyle.height` can be found [here](https://main-api.flutter.dev/flutter/painting/TextStyle/height.html) (the one from `painting` library not `dart:ui`).
 
part of https://github.com/flutter/flutter/issues/58765: currently `TextStyle.height` uses `null` as the sentinel value for "no height multiplier specified, use the font height", which has conflicting semantics: it means the height multiplier is not set (so the span height is determined by font metrics) but in reality it also means the height should inherit from its parent span (or in `copyWith` context, it means do not override the height).

The new sentinel value `kTextHeightNone` is currently set to `0.0`. This is because skparagraph internally uses 0 for "no height multiplier", so using 0 should minimize the behavior change: 
62f369c759/modules/skparagraph/src/Run.cpp (L65-L67)

This MAY still change the current behavior: for consistency setting `StructStyle.height` / `ParagraphStyle.height` to the sentinel value also unsets the height multiplier which may not be the current behavior.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-24 00:16:16 +00:00
gaaclarke
6b11db0352 Reland Fixes MatrixFilterContents rendering/coverage #52880 (flutter/engine#52939)
fixes https://github.com/flutter/flutter/issues/147807
relands https://github.com/flutter/engine/pull/52880
relands https://github.com/flutter/engine/pull/43943

This was previously reverted because of the golden test failure `widgets.widgets.magnifier.styled`.  This fixes that problem by instead of focusing on ImageFilter and BackdropFilter subpasses, instead focuses on wether a subpass is clipped or not and by extension how the math should be handled.

`widgets.widgets.magnifier.styled` after diff:

![widgets widgets magnifier styled](https://github.com/flutter/engine/assets/30870216/d4611586-90f7-4d3e-90d8-018dd678d028)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-21 19:09:25 +00:00
Brandon DeRosier
2ffd763cfb [Impeller] Reland: Remove Entity capture/AiksInspector. (flutter/engine#52932)
Resolves https://github.com/flutter/flutter/issues/134748.

This was a really fun experiment. I learned a lot from it, and it
genuinely helped me solve some coverage-related problems, but the
reality is it was too little too late -- by the time we had this
capture system, we had already solved most of the problems that would
have benefitted from this.

It's been a few months since I've used or extended the capabilities of
this capture system for something, and I don't have the spare
time/energy to give it the love it needs to realize the vision I had
for it. I still almost exclusively use a combination of native frame
captures and print debugging to solve problems.

RIP in peace.

This reverts commit 104eb98e62. (https://github.com/flutter/engine/pull/52680)
2024-05-21 00:59:14 +00:00
auto-submit[bot]
bf47498373 Reverts "Fixes MatrixFilterContents rendering/coverage (#52880)" (flutter/engine#52918)
Reverts: flutter/engine#52880
Initiated by: jonahwilliams
Reason for reverting: unexpected framework golden change
Original PR Author: gaaclarke

Reviewed By: {bdero}

This change reverts the following previous change:
fixes: https://github.com/flutter/flutter/issues/147807
relands https://github.com/flutter/engine/pull/43943 (with fixes that hopefully avoid it being reverted again)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-18 03:01:46 +00:00
gaaclarke
4cb23c3af7 Fixes MatrixFilterContents rendering/coverage (flutter/engine#52880)
fixes: https://github.com/flutter/flutter/issues/147807
relands https://github.com/flutter/engine/pull/43943 (with fixes that hopefully avoid it being reverted again)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-18 00:43:35 +00:00
auto-submit[bot]
ea811b97ba Reverts "Manual roll of Clang from 725656bdd885 to 145176dc0c93 (#52823)" (flutter/engine#52890)
Reverts: flutter/engine#52823
Initiated by: zanderso
Reason for reverting: Engine crashes on framework CI following this roll https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20flutter_gallery__transition_perf_with_semantics/12126/overview
Original PR Author: jason-simmons

Reviewed By: {zanderso}

This change reverts the following previous change:
See https://github.com/flutter/flutter/issues/143178
2024-05-16 22:01:38 +00:00
Jason Simmons
31d7cb2870 Manual roll of Clang from 725656bdd885 to 145176dc0c93 (flutter/engine#52823)
See https://github.com/flutter/flutter/issues/143178
2024-05-16 17:16:21 +00:00
Jason Simmons
6ee57afaf3 Migrate third_party/gradle to flutter/third_party/gradle (flutter/engine#52814)
Based on https://github.com/flutter/engine/pull/52030
2024-05-14 20:51:10 +00:00
Jason Simmons
e6f329968d [Impeller] Create framebuffer blend vertices based on the snapshot's texture size instead of coverage (flutter/engine#52790)
The snapshot's transform is provided to the pipeline.  If the vertices are based on the coverage rectangle, then that will apply the snapshot's transform twice.

Fixes https://github.com/flutter/flutter/issues/148213
2024-05-14 16:36:47 +00:00
Zachary Anderson
a1257de605 Simplify GN pools, use in more places (flutter/engine#52721)
This PR changes from using a different GN pool for each non-compiler tool, to using one GN pool for everything.

Additionally, since we are no longer linking remotely in any configuration, this PR uses the pool for linking.

ObjC and impellerc tasks also do not (yet) run on RBE, so they are also now governed by the pool.

Needs https://github.com/flutter/buildroot/pull/856
2024-05-10 22:43:23 +00:00
Matan Lurey
70b18ec727 Write dart:ui golden-file tests testing FilterQuality.* (flutter/engine#52687)
Work towards https://github.com/flutter/flutter/issues/147259.

Most of this is just me understanding how `FilterQuality.*` feeds into the rest of the engine, and updating our testing documentation so we all understand how to re-run these tests in the future. Here is an example output of both Impeller and non-Impeller output of `image_filter_test`:

<img width="485" alt="Screenshot 2024-05-08 at 2 25 53 PM" src="https://github.com/flutter/engine/assets/168174/58e6a4f5-98e2-4b9e-b181-4ff613ad4d29">
2024-05-10 22:15:23 +00:00
Jenn Magder
c24f7454d0 Migrate FlutterView, FlutterPlatformViews, FlutterOverlayView to ARC (flutter/engine#52535)
Smart pointers support ARC as of
https://github.com/flutter/engine/pull/47612, and the unit tests were
migrated in https://github.com/flutter/engine/pull/48162.

Migrate `FlutterView`, `FlutterPlatformViews`, and `FlutterOverlayView`
from MRC to ARC.

Part of https://github.com/flutter/flutter/issues/137801.
2024-05-10 12:07:30 -07:00
gaaclarke
06ee68755c [Impeller] Adds impeller display list golden tests (flutter/engine#52690)
issue https://github.com/flutter/flutter/issues/146941

## 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-05-09 13:34:46 -07:00
Jenn Magder
d4f698b036 Fix UIVisualEffectView leak in platform view filter (flutter/engine#52591)
I found this while migrating `FlutterPlatformViews_Internal.mm` to ARC https://github.com/flutter/engine/pull/52535.  I'll land this first.

```objc
  if (_backdropFilterView != visualEffectView) {
    _backdropFilterView = [visualEffectView retain];
  }
```
should instead be something like:
```objc
  if (_backdropFilterView != visualEffectView) {
    id oldBackdropFilterView = _backdropFilterView;
    _backdropFilterView = [visualEffectView retain];
    [oldBackdropFilterView release];
  }
```
But that's already what the built-in MRC `nonatomic, retain` property setter does, so use that instead.

Added a test that passes on this PR and fails on main.
2024-05-08 22:40:16 +00:00
gaaclarke
104eb98e62 Revert 7130c5c3b3f16d549bca6b81c51c751780c454d4 (flutter/engine#52680)
reverts https://github.com/flutter/engine/pull/52526
fixes https://github.com/flutter/flutter/issues/147989

That PR has broken playgrounds.  It's non essential so we can revert it an bdero can take a look whenever he gets another chance.

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