1583 Commits

Author SHA1 Message Date
Jim Graham
57d78e3da4 [DisplayList] Fix assertions on DisplayList verbose comparison tests (flutter/engine#54065)
Fixes 2 problems recently uncovered in the DisplayList verbose comparison test mechanism:

- The verbose compare methods never asserted a test failure, relying on the caller to do so from their return value - but they also did not prompt the caller to check the return value. So a `[[nodiscard]]` is added to remind test writers that they need to assert on the return value
- As a result of the above, some bad tests were recently added to the tree that were failing but did not assert a test failure. Now that the `[[nodiscard]]` is added, they failed to compile and had to have asserts added.

A secondary problem is that those non-failing tests were inadvertently cherry-picked from a reverted PR that is being reintroduced in incremental sections so as to avoid large scale golden image failures. The tests depend on parts of that PR that haven't been pulled forward yet (but will soon be) so those tests shouldn't have been added in the first place (and were failing, but not causing a gtest failure because of their missing asserts). They remain here, but their results are reversed to indicate the current state of affairs (they assert that the missing functionality isn't in place yet). Their assertions will be reverted when/as the missing functionality is pulled forward in a more incremental (responsible) way.
2024-07-24 00:18:05 +00:00
Jim Graham
3aafd537ae [DisplayList] track unbounded state on save layers and DisplayLists (flutter/engine#54032)
New flags on SaveLayerOptions will report if a saveLayer result is unbounded because a rendering operation within its contents did not have a definable bounds and there was no clip installed at the time (consider DrawPaint for example). A similar flag is found on DisplayList objects which reports if their top level had an unbounded operation.
2024-07-23 18:15:18 +00:00
Chinmay Garde
f4e4700369 [Impeller] Implement OpenGL to Vulkan texture trampolining. (flutter/engine#53966)
This decouples the Impeller on-by-default effort from the release schedule and [plugin migrations](https://github.com/flutter/flutter/issues/151018).

The plugin migration documented in [go/impeller-plugin-migration][plugin-migration] is still recommended and facilitates zero-copy texture transfers between OpenGL and Vulkan. To recap, the plugin migration is to move away from the OpenGL-only SurfaceTexture APIs in the plugin interface.

This patch facilitates rendering OpenGL textures in a Vulkan renderer using texture trampolining using a single device-device transfer on all devices that support Impeller using the Vulkan renderer.

The performance of this approach is more than acceptable but at the cost of an additional texture allocation and will serve as a fallback to the for any remaining unmigrated plugins (all first-party plugins will already be migrated when the Impeller is on by default and we are following up on the migration of the major third-party plugins as well).

This is a straight improvement to the current state of things were unmigrated plugins will render an empty quad.
2024-07-23 16:41:20 +00:00
Robert Ancell
4a63063be6 Renamed plugin classes to handler (flutter/engine#53736)
The Linux embedder had a number of handlers for Flutter channels that
were named plugin/handler/manager. Rename these all to handler to be
consistent and reduce confusion with Flutter plugins (which these don't
use the infrastructure for).
2024-07-19 12:44:41 +12:00
Zachary Anderson
441fb4562c Fix race in image_filter_test.dart (flutter/engine#53996)
Fixes https://github.com/flutter/flutter/issues/151973
2024-07-18 17:47:05 +00:00
Jim Graham
2d58c39615 [Impeller] Convert basic AIKS golden tests to use DisplayList (flutter/engine#53969)
Converts several AIKS golden tests to use DisplayList as the mechanism.

In order to convert some of the tests, new factory methods were added to DlColor and tested with new unit tests (an earlier golden test conversion PR had a version of this as well).

Also, a new DisplayList record op was created for ClipOval to handle the AIKS clipping golden tests, but this new recording op is not used from Flutter `ui` code (no plumbing to call it from `lib/ui/painting` or to convert any other DisplayList call to use the new record). An earlier attempt to add the new recording op caused a large number of golden changes upstream so this version will only be used for internal tests and support to use it from apps will follow in more targeted PRs to better manage golden changes. This PR should not result in any changes to goldens outside of internal engine tests.
2024-07-17 23:11:55 +00:00
Brandon DeRosier
fc18d5bc59 [Impeller] Use depth transform in framebuffer blend entities. (flutter/engine#53951)
\Without this the depth always ends up being a very large z depth of 0.5, which can cause clips to be ignored.
2024-07-16 23:17:17 +00:00
Lasse R.H. Nielsen
13b3c93787 Prepare engine for deprecation of async_minitest.dart (flutter/engine#53560)
The Dart SDK's `package:async_helper/async_minitest.dart` was never intended for new tests, it was a drop-in polyfill for the legacy `package:unit_test` that some Dart SDK tests were using. The tests should never have used that package, and migrating them to `package:test` was not an option, so the `async_minitest.dart` file was the minimal polyfill that made all the tests run.

Since then, new tests have been written using the file, and to stop that, the file will now become deprecated, and (hopefully some day) removed.

If the Flutter engine wants to keep using the file, they should own their own copy of it, which is what this change does.

(Also migrates off the to-be-deprecated `assertStatementsEnabled` property of `package:expect/expect.dart`, moved to the new `asserts` from `package:expect/variations.dart`.)
2024-07-12 19:12:05 +00:00
Matan Lurey
15becdc41e Move //third_party/java to //flutter/third_party/java (flutter/engine#53590)
... as part of buildmoot.
2024-07-12 09:25:28 -07:00
Jonah Williams
a53478d613 [Impeller] Ensure full transform is applied to text contents (flutter/engine#53819)
Fixes https://github.com/flutter/flutter/issues/151521

My change made the text size absorb the scale, so I wasn't applying the full transform. That is incorrect if there are negative scales.
2024-07-11 23:28:56 +00:00
Jonah Williams
ac871bacc2 [dart:ui] remove expensive index assertion in Vertices. (flutter/engine#53558)
Iterating through every index value is really, really expensive. Especially if users are suppllying hundreds of thousands of vertices.
2024-07-11 22:13:04 +00:00
Jonah Williams
6ba3e46d9a [Impeller] fix incorrect padding/translation in drawVertices with texture coordinates. (flutter/engine#53746)
Fixes https://github.com/flutter/flutter/issues/151355

The coverage pad introduced by renderToSnapshot is being picked up by drawVertices with texture coordinates. The pad is showing up in the final results, which can appear to be a gap between elements.

Additionally: if the coverage computed from the texture coordinates does not include the origin, then make sure the coverage used for the snapshot is translated onscreen.
2024-07-08 20:12:49 +00:00
Jim Graham
b4a744f468 [Impeller] Re-enable fast blur path for elliptical rrects (flutter/engine#53704)
Fixes https://github.com/flutter/flutter/issues/151034

Fast round rects were recently restricted to circular corners, but elliptical round rects can also go through the fast path.
2024-07-04 00:01:24 +00:00
Matan Lurey
0e6a951a57 Convert run_ios_tests.sh to run_ios_tests.dart. (flutter/engine#53645)
Part of https://github.com/flutter/flutter/issues/143953.

Because there are so many boundary cases, i.e. tests failed uploading artifacts to LUCI, I  was _not_ planning on atomically deleting and replacing `run_ios_tests.sh`, and want to give a chance for the iOS team to try the converted code and verify it works the way they expect.

I'm also happy to just slam it on, but defer to y'all. _It works on my machine_.

---

```sh
dart run testing/scenario_app/bin/run_ios_tests.dart
```
2024-07-03 19:01:31 +00:00
Jia Hao
667bd9dd55 Revert "Reland [DisplayList] Add support for clipOval to leverage Impeller optimization" (flutter/engine#53705)
Reverts flutter/engine#53642

This change causes 10k golden updates internally and we need to land this out of band (go/lssc). There is also an existing issue with one particular client screenshot test - see b/350129213 for more details.
2024-07-03 04:25:18 +00:00
Jim Graham
702c6cec66 [Impeller] fix typo in setup for fast elliptical rrect blurs (flutter/engine#53673)
This typo was discovered while converting the AIKS tests to DisplayList - the new test executes correctly, but the old test generated bad goldens due to this typo. Fixing the typo to fix the golden prior to landing the test conversion.

The fix should be covered by existing tests - in fact the change is correcting an already bad golden test to correct behavior.
2024-07-02 20:44:16 +00:00
Jim Graham
54c6058748 Reland [DisplayList] Add support for clipOval to leverage Impeller optimization (flutter/engine#53642)
Reland of https://github.com/flutter/engine/pull/53622 that checks the inverse fill flag of the paths.
2024-06-28 20:52:21 +00:00
Jim Graham
86ee502292 Revert "[DisplayList] Add support for clipOval to leverage Impeller optimization" (flutter/engine#53629)
Reverts flutter/engine#53622

There were some golden changes which might be minor, but they weren't expected. Also, I noticed a problem in reducing drawPath down to drawRect and drawOval - that should not be done if the path has the inverse fill flag set...
2024-06-28 11:07:21 +00:00
Jim Graham
c47337f291 [DisplayList] Add support for clipOval to leverage Impeller optimization (flutter/engine#53622)
Impeller supports `ClipOval` and will detect oval paths and rrects and use that call instead when appropriate. Adding support for `ClipOval` to DisplayList allows that optimization code to be moved up into the recording process.
2024-06-28 03:34:23 +00:00
Gray Mackall
8e2c560e10 Re-re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53592)
Re-re-re-land https://github.com/flutter/engine/pull/53001.

I recreated the postsubmit failures of the [roll](https://github.com/flutter/flutter/pull/150733) of the [last land](https://github.com/flutter/engine/pull/53532), and then verified on a local branch that those same postsubmits pass with this upgrade after the land of https://github.com/flutter/flutter/pull/150873. 

So I have pretty high confidence this won't cause any problems in the framework repo. I also tested on a previous land attempt that the `all_packages` app builds on this branch, so that is also a good sign for the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-27 19:56:47 +00:00
Jim Graham
34bb05029e [DisplayList] Switch to recording DrawVertices objects by reference (flutter/engine#53548)
The Vertices objects are already allocated in a shared object by default so copying them inline into the recording buffer is usually a waste of time rather than reusing the memory allocated for the shared object by recording a reference. Note that the shared DlVertices objects already inline all of their data so we have good data locality as it is without further copying the data into the buffer.

Might help with https://github.com/flutter/flutter/issues/150513
2024-06-25 17:41:14 +00:00
auto-submit[bot]
c352f44015 Reverts "Re-re-land "Upgrade all[most] androidx dependencies to latest" (#53532)" (flutter/engine#53546)
Reverts: flutter/engine#53532
Initiated by: gmackall
Reason for reverting: This breaks apps that use plugins that use compileSdk 31, some of which we use in our postsubmit (so it blocks the tree).
Original PR Author: gmackall

Reviewed By: {reidbaker, matanlurey}

This change reverts the following previous change:
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-25 01:20:29 +00:00
Gray Mackall
f9b2f290ba Re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53532)
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-24 21:36:22 +00:00
Matan Lurey
233edc0b8f Add SurfaceProducer.Callback lifecycle hooks (flutter/engine#53280)
Work towards https://github.com/flutter/flutter/issues/148417.
2024-06-24 08:06:56 -07:00
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