1681 Commits

Author SHA1 Message Date
Gray Mackall
c5d163fccb Delete v1 android engine embedding (flutter/engine#52022)
Fixes https://github.com/flutter/flutter/issues/143531

Other failures from the initial attempt are fixed in https://github.com/flutter/flutter/pull/146523/
2024-10-23 21:12:52 +00:00
Brandon DeRosier
026062f08b [Flutter GPU] Fix assert failure in createDeviceBufferWithCopy. (flutter/engine#56039)
Resolves https://github.com/flutter/flutter/issues/157336

`DartByteData` gets raw pointers into the Dart heap via `Dart_TypedDataAcquireData`. So it must be destructed before `AssociateWithDartWrapper` is called, which mutates the heap.

Re-enables failing test for Linux unopt.
2024-10-23 05:08:03 +00:00
yaakovschectman
32d9706cec Fix typo in testing script (flutter/engine#56029)
Just fix the spelling of `warning`.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-22 19:08:12 +00:00
Brandon DeRosier
3b568c8d68 [Flutter GPU] Fix conditional when checking DeviceBuffer bounds. (flutter/engine#56017)
Resolves https://github.com/flutter/flutter/issues/157324

Fix a silly off-by-one that I didn't catch because none of the tests are using `DeviceBuffer` directly. 🤦
2024-10-22 10:58:38 +00:00
Brandon DeRosier
493177b5ed [Flutter GPU] Add missing MSAA stuff. (flutter/engine#55424)
Resolves https://github.com/flutter/flutter/issues/144264.
2024-10-22 01:16:25 +00:00
Jim Graham
6b912e50de [Impeller] New impeller round rect class (flutter/engine#55946)
Impeller geometry class analogous to SkRRect - soon to be the standard round rectangle class throughout most of the engine that doesn't talk directly to Skia.

More unit tests are being written, but this PR will enable developers to look at the API of the new class and comment as well as test its effect on any goldens (there should be none).
2024-10-20 18:59:23 +00:00
gaaclarke
4ffade7c5b Started filtering out close line segments in rrect polylines. (flutter/engine#55929)
fixes https://github.com/flutter/flutter/issues/156422

tests: AiksTest.GradientOvalStrokeMaskBlurSigmaZero

This filtering needs to happen somewheres.  I opted for putting it inside of the AddLinearComponent instead of where it was affected me in the test: 45237cc63f/impeller/geometry/path_builder.cc (L180)

This seems preferable.  A tiny line segment should never matter.  The rub is that its only happening here.  We might want to do this in other places as well.  It's equally unimportant to have a tiny curve.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-18 21:54:04 +00:00
Jonah Williams
f0f29ce37f [Impeller] add mechanism for sharing bdf inputs. (flutter/engine#55701)
Introduces a mechanism to allow backdrop filters to 1) share backdrop inputs and 2) fuse filter applications for faster blurs.

This is a proposed solution to https://github.com/flutter/flutter/issues/131568

Implemented:
* Developer can specify a "backdrop id" which indicates that a backdrop layer should share the input texture and potentially cached filter for a layer.
* Removes second save layer for each backdrop filter
* Removes save layer trace event for backdrop filter
* Can fuse backdrop filters if there is more than one identical filter

TBD:
* Adjust heruristic to avoid applying bdf filter to entire screen

Suggestions: applying a bdf should be a distinct operation from a save layer in the DL builder/dispatcher. The saveLayer implmenentation in the impeller dispatcher is super convoluted because it needs to handle both.

### Video

Video starts with normal bdf then I hot reload to specify that the bdfs share inputs/filters. This is running on a pixel 8 pro

Change to the macrobenchmark app is just:
```dart
  Widget build(BuildContext context) {
    Widget addBlur(Widget child, bool shouldBlur) {
      if (shouldBlur) {
        return ClipRect(
          child: BackdropFilter(
            filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
            backdropId: 1, // Added ID
            child: child,
          ),
        );
      } else {
        return child;
      }
    }
```

https://github.com/user-attachments/assets/22707f97-5825-43f1-91b4-1a02a43437f5

Requires framework changes in https://github.com/jonahwilliams/flutter/pull/new/backdrop_id
2024-10-18 15:38:34 +00:00
Brandon DeRosier
518ada1675 [Flutter GPU] Remove Command/VertexBuffer usage from Flutter GPU. (flutter/engine#55893)
Resolves https://github.com/flutter/flutter/issues/156764.
Resolves https://github.com/flutter/flutter/issues/155335.

- Remove Command/VertexBuffer from Flutter GPU.
- Separate vertex/index count into `impeller::RenderPass::SetElementCount(size_t count)` & accurately document its behavior.
- Make Flutter GPU uniform/texture bindings re-assignable.
- Remove unnecessary templates.
2024-10-17 22:39:19 +00:00
Yegor
4a93a6a08b Introduce SemanticsFlag.hasSelectedState to the engine API (flutter/engine#55780)
Introduce `SemanticsFlag.hasSelectedState` to the engine API. At this point the flag is not backed by any engine functionality. See also: https://github.com/flutter/flutter/issues/66673#issuecomment-2402903402

| ⚠️ WARNING           |
|:----------------------------|
| Submit _AFTER_ https://github.com/flutter/flutter/pull/157017 and https://github.com/flutter/flutter/pull/157061 land in the framework     |

A step towards https://github.com/flutter/flutter/issues/66673
2024-10-17 22:01:34 +00:00
Jonah Williams
d3ed232dab [Impeller] flood input coverage with destructive color filter. (flutter/engine#55758)
Fixes https://github.com/flutter/flutter/issues/126389
Fixes https://github.com/flutter/flutter/issues/137090
Fixes https://github.com/flutter/flutter/issues/154035

If this bit is set, the output of a color filter should flood to the input of a filter to parent clip. We're not checking this right now and so all color filter content is treated as bounded.

This needs to flood the input as the image filter (which occurs afterwards) should process the flooded input.
2024-10-17 02:30:01 +00:00
Jonah Williams
61460afe48 [Impeller] remove STB backend. (flutter/engine#55842)
Delete the STB typographer backend.

Fixes https://github.com/flutter/flutter/issues/156429
2024-10-14 18:16:20 +00:00
Jim Graham
9e747c2eb6 Delete last usages of MockCanvas test mechanism (flutter/engine#55840)
The MockCanvas API was originally used to test the output of rendering methods to match them against a reference set of "MockData" structures. This API has been superseded by just using a DisplayListBuilder to record reference operations and then to compare the resulting DisplayList objects.

This PR deletes the last remaining uses of MockCanvas as well as the mechanism itself.
2024-10-12 05:15:17 +00:00
AthulJoseph
3214f65fa3 [Impeller] Added support to set polygon mode in Flutter GPU. (flutter/engine#55804)
Added support to set polygon mode in Flutter GPU. This fixes the issue [#142732](https://github.com/flutter/flutter/issues/142732).
2024-10-12 01:07:36 +00:00
Jim Graham
3f0d57e071 [DisplayList] Create DlFoo type variants to start moving away from Skia types in API (flutter/engine#55812)
This is the beginning of the bulk of de-skia-fication work in the engine. All of the standard types in the DlCanvas API now have overloads that specify the corresponding Dl type, mainly for Dl*Rect and DlPoint types. This enables further work to switch from SkFoo types to DlFoo types in the various engine modules culminating in the elimination of the old methods that use the Sk types.

All of the former methods that used the basic Sk types are now implemented as inlinable translation overloads and the underlying implementations of DlCanvas now implement only the newer style interfaces so that they don't need to be further modified as we eliminate the old Skia types from the interface.

There are still a couple of Skia types remaining in the DlCanvas API without any DL type variants which will be handled in a future phase:
- SkRRect
- SkRSXform
- SkTextBlob (will be hidden behind a common interface along with TextFrame)
- SkImageInfo (only used in a few calling sites)
2024-10-11 00:42:23 +00:00
gaaclarke
90cea20d09 fixes mask blurs on stoked gradient geometry (flutter/engine#55717)
fixes https://github.com/flutter/flutter/issues/155930

This starts taking into account the translation of the entity that is
snapshotted when performing the gaussian blur. I'm uncertain under what
conditions, but sometimes the snapshot logic would need this offset. The
linked issue and added tests demonstrate those cases.

## 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-10-08 15:20:50 -07:00
Jason Simmons
d8d3d6ac4b [Impeller] Do not scale the miter limit applied to stroked text (flutter/engine#55745)
Fixes https://github.com/flutter/flutter/issues/156224
2024-10-08 22:07:19 +00:00
AthulJoseph
a01daf5555 Added support to set primitive type (flutter/engine#55514)
Added a way to specify the PrimitiveType when encoding commands in the RenderPass.

This partially fixes the issue #142732
2024-10-08 21:57:10 +00:00
Jim Graham
ab7af6ffb2 Honor blur tile mode in BackdropFilter widget on Skia backend (flutter/engine#55640)
The blur ImageFilter has a tile mode that describes how to sample pixels near the edge of the source. When used as a BackdropFilter this behavior is important as the wrong tile mode can cause distracting flashing as app content is scrolled under foreground widgets that blur their background. Unfortunately the Skia backend used to default the tile mode for all backdrop filters to `clamp` mode with no way to update it and that mode was the one that produced the most distracting flashing.

Recently Skia opened up control over the tile mode used for backdrop filters and we now take advantage of that capability so that app developers can now set the tile mode to a nicer value.
2024-10-05 04:58:30 +00:00
Brandon DeRosier
3b3ffcb8cd [Flutter GPU] Add WindingOrder. (flutter/engine#55413)
Resolves https://github.com/flutter/flutter/issues/155636.

(Extends test in https://github.com/flutter/engine/pull/55409)
2024-10-05 02:04:04 +00:00
Jim Graham
7f99da5b92 [Impeller] Use a squircle-sdf-based algorithm for fast blurs (flutter/engine#55604)
Use a Squircle Signed Distance Field based algorithm to do a very fast approximation of rrect blurs.

This PR is to provide reference within the team to discuss the future of the algorithm compared to the Gaussian approximation functions that are currently in use. It isn't a complete solution, but can be completed easily with a little more work.

Notably, it doesn't handle elliptical round rects, only circular corners.
Could stand to include an attribution to the source (https://raphlinus.github.io/graphics/2020/04/21/blurred-rounded-rects.html)
2024-10-04 20:24:15 +00:00
Jonah Williams
9d8929af60 [Impeller] generate mipmaps for toImage. (flutter/engine#55655)
Fixes https://github.com/flutter/flutter/issues/156161

Mips must be eagerly generated for Picture.toImage and friends so that filter quality (mip sampling) works as expected.
2024-10-04 17:49:55 +00:00
Jonah Williams
959b7c6b60 [Impeller] clamp render target size at max texture size. (flutter/engine#55628)
Part of https://github.com/flutter/flutter/issues/128912

If an intermediate render target would be larger than the max texture size, then clamp the texture.
2024-10-04 03:39:14 +00:00
Jason Simmons
3ad82894c5 [Impeller] Do not cull in TextFrameDispatcher::drawDisplayList if the transform has perspective (flutter/engine#55602)
Fixes https://github.com/flutter/flutter/issues/155947
2024-10-03 19:26:05 +00:00
Jonah Williams
c95afa281b Fix npe during skia dispatch of drawAtlas (flutter/engine#55497)
Colors are optionally provided, so make sure to null check the array.

Fixes https://github.com/flutter/flutter/issues/155783
2024-09-28 19:13:18 +00:00
Jason Simmons
faa865b425 [Impeller] Apply some recent color filter fixes to BlendFilterContents::CreateForegroundAdvancedBlend (flutter/engine#55470)
Some recent changes affecting color filters (https://github.com/flutter/engine/pull/55411, https://github.com/flutter/engine/pull/55448) need to be done for both Porter-Duff and advanced blend modes
2024-09-27 21:42:49 +00:00
Jonah Williams
b9d92a4d0c [Impeller] remove entity pass and re-combine canvas implementations. (flutter/engine#55019)
Shouldn't land until experimental canvas bakes a while

Major milestone along the route to making display list the impeller API. Removes the secondary compositor in entity pass. After this point, we can begin ripping out the DL->Aiks conversions and making entities more efficient.

Fixes https://github.com/flutter/flutter/issues/132417
Fixes https://github.com/flutter/flutter/issues/126386
Fixes https://github.com/flutter/flutter/issues/155114

Part of https://github.com/flutter/flutter/issues/142054
2024-09-26 21:20:23 +00:00
gaaclarke
015281d470 fixes color filter + advanced blends (flutter/engine#55448)
fixes https://github.com/flutter/flutter/issues/155691

I'm also renaming the test I just introduced, it was named wrong, talking about "image filter", not "color filter".

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-26 16:20:06 +00:00
gaaclarke
ad894bd2f0 Fixes blend + color filter (flutter/engine#55411)
fixes https://github.com/flutter/flutter/issues/155456

Thanks @jason-simmons for identifying the fix.

## 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-09-25 12:57:45 -07:00
Jonah Williams
1878326071 [scenario_app] delete get bitmap activity. (flutter/engine#55436)
Since we can't see the screenshot we can't really evaluate if this is failing for good/bad reasons. This also uses
 the whoe convertToImageREader / readback debugging API that I want to delete.
2024-09-25 19:14:29 +00:00
Brandon DeRosier
31ac0fc004 [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416)
Resolves https://github.com/flutter/flutter/issues/155627.

Allow setting the clear directly as floats without conversion work. vector_math already has convenient `Colors.[color]` factories and such. Also, `ui.Color` has a color space now, which does not apply here.

Adds a simple golden to verify that clear colors work:
![flutter_gpu_test_clear_color](https://github.com/user-attachments/assets/ba7a4e74-aaf2-48d8-ac13-115a86daeb19)
2024-09-25 18:02:05 +00:00
Brandon DeRosier
e496b1ed26 [Flutter GPU] Add CullMode. (flutter/engine#55409)
Part of https://github.com/flutter/flutter/issues/155636.

New golden `flutter_gpu_test_cull_mode` will draw a red triangle if the CullMode isn't working:
![flutter_gpu_test_cull_mode](https://github.com/user-attachments/assets/cbdf804e-1608-4352-9aa1-d5d9223f3c1a)
2024-09-25 00:52:11 +00:00
Brandon DeRosier
c4514370d7 [Flutter GPU] Add pipeline stencil config. (flutter/engine#55272)
Also adds a golden that depends on https://github.com/flutter/engine/pull/55270.
Resolves https://github.com/flutter/flutter/issues/142731.

Allow setting the stencil compare function, pass/fail operations, and read/write masks.

Flutter GPU has light "shader object" style programs, so all of the stencil configuration state can be set on the `RenderPass` at any time.

New simple golden that exercises stencil ops:
![flutter_gpu_test_triangle_stencil](https://github.com/user-attachments/assets/acc98cd9-41fc-4988-97a2-afb898a8fc0c)
2024-09-24 21:26:29 +00:00
Brandon DeRosier
7242297f80 [Flutter GPU] Add setStencilReference to RenderPass. (flutter/engine#55270) 2024-09-24 11:27:25 -07:00
gaaclarke
9f66178386 Reland: Update Color to do all calculations with floating point components (flutter/engine#55231)
Reason for revert: Broke customer tests
Reland depends on https://github.com/flutter/flutter/issues/155113

This transforms the rest of Color to use the floating point parameters.  This will likely break existing tests very subtly.  For example, colors will be slightly different in golden tests if `lerp` was ever used.

issue: https://github.com/flutter/flutter/issues/127855

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-23 17:43:52 +00:00
Brandon DeRosier
a2fe41a763 [Flutter GPU] Remove the redundant smoketest. (flutter/engine#55267)
This is placeholder stuff that I added before the rest of the API to prove that we can call the engine symbols.

Today this is totally redundant as Flutter GPU has a bunch of automated tests which exercise every FFI call.
2024-09-17 22:24:07 +00:00
Brandon DeRosier
759d173073 [Flutter GPU] Add DeviceBuffer.flush & GpuContext.getMinimumUniformByteAlignment. (flutter/engine#53620)
Part of https://github.com/flutter/flutter/issues/150953.

Provide a way to get the required minimum uniform byte alignment when referencing uniform blocks in a device buffer. Allow the user to explicitly flush DeviceBuffers (necessary for devices without shared memory).
2024-09-17 20:31:50 +00:00
Brandon DeRosier
ea026548ce [Flutter GPU] Add golden test for rendering a triangle. (flutter/engine#55262)
Resolves https://github.com/flutter/flutter/issues/144640.

New golden:
![flutter_gpu_test_triangle](https://github.com/user-attachments/assets/0b39380e-1aa5-4369-ae5b-a8764d5701cb)
2024-09-17 20:00:33 +00:00
Jim Graham
7da9ad1862 Delete VolatilePathTracker in favor of Dispatch tracking (flutter/engine#55125)
ui.Canvas and ui.SceneBuilder now use the DlPath object directly from the ui.Path object. This results in increased sharing of the wrapper objects which then increases the sharing of both the converted Impeller paths and Skia's volatile flag.

The VolatilePathTracker mechanism is deleted and rather than count the number of frames that a path is stable for, instead we count the number of times it is used for rendering. If a path is used 100 times in a single frame, it will become non-volatile and start being cached almost immediately. The cached Impeller paths are now also tracked for all instances of the same path, rather than for each call site that originated from a DisplayList dispatch.
2024-09-13 21:49:09 +00:00
Reid Baker
415f89e20a add back test itSendsTextShowPasswordToFrameworkOnAttach with new mock for display metrics (flutter/engine#55110)
Part 1/5 for re adding tests documented in flutter/flutter/issues/154746

## 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.
2024-09-13 13:45:37 -04:00
Matan Lurey
c53db189c1 Remove now unused extra args/opts/env from run_tests.py. (flutter/engine#55164)
As a result of https://github.com/flutter/flutter/issues/133569, Dart tests all use the standard `dart test` runner _or_ `engine_repo_tools` to find paths.
2024-09-13 01:22:18 +00:00
Matan Lurey
02d5118165 Remove assert(() {... }) and other unnecessary patterns in dart:ui tests (flutter/engine#55165)
Closes https://github.com/flutter/flutter/issues/155054, where we
decided this was correct to do.

As a bonus I improved an `assert` message :)
2024-09-12 17:40:52 -07:00
Matan Lurey
425e6c707d Remove all references to litetest from the engine repo. (flutter/engine#55163)
Closes https://github.com/flutter/flutter/issues/133569.
2024-09-12 16:26:25 -07:00
Brandon DeRosier
16acb8258a Remove Impeller Scene 👋 (flutter/engine#55118)
Impeller Scene has been fully rewritten as a Dart library for Flutter: https://pub.dev/packages/flutter_scene
2024-09-12 14:56:08 -07:00
gaaclarke
f9093e1b13 Revert "Update Color to do all calculations with floating point components" (flutter/engine#55153)
Reverts flutter/engine#54981

This is causing failures in customer tests that need to be updated:
https://github.com/flutter/flutter/pull/155107/checks?check_run_id=30069840819
2024-09-12 13:01:37 -07:00
Matan Lurey
37f629a23f Migrate more tests from litetest to package:test (flutter/engine#55119)
Partial work towards https://github.com/flutter/flutter/issues/133569.

Commentary on removal of `assert`-conditionals here: https://github.com/flutter/flutter/issues/155054.
2024-09-12 19:01:05 +00:00
gaaclarke
c7d96a38bc Update Color to do all calculations with floating point components (flutter/engine#54981)
This transforms the rest of Color to use the floating point parameters.  This will likely break existing tests very subtly.  For example, colors will be slightly different in golden tests if `lerp` was ever used.

issue: https://github.com/flutter/flutter/issues/127855

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-12 16:30:06 +00:00
Matan Lurey
5aee88abfb Migrate const_finder_test to use package:test (flutter/engine#55132)
... instead of some home-grown framework.

This is the last test in the engine that uses custom command line arguments to start. As of this PR, `dart test` including full debugging in an IDE works across all Dart tooling code.

I tried to make this idiomatic as much as possible without changing the logic.
2024-09-12 15:30:33 +00:00
Jim Graham
bc69788f05 [DisplayList] DlPath object provides auto-conversion from Skia to Impeller (flutter/engine#55055)
Switch from using the clumsy manual CacheablePath object to a more automatic DlPath object for holding paths in DisplayLists and dispatching them to either Skia or Impeller with auto-conversion.

For now DlPath is just a wrapper around SkPath with an auto-generating Impeller Path object which is very similar in design from what was done with the CacheablePath object except that it manages the caching of the Impeller path internally without extra burden on Impeller or Skia. There is also no need to communicate with the Dispatch method as to which type of path you prefer, they're all "auto-converting" DlPath objects now.

For now, ui.Path still generates an SkPath and so we wrap it when we record it into a DisplayList, just like the former CacheablePath mechanism. It will be a simple conversion to create the DlPath wrapper in ui.Path, though, so as to maintain the cached Impeller paths across frames even if the DisplayList itself is not preserved.

Eventually DlPath will take on more of a role of hiding the construction and internal representation of the paths so that we could be using SkPath, impeller::Path, or some other internal storage. For now, SkPath will likely remain primary storage for a while so that we can deal with PathOps.
2024-09-12 01:20:59 +00:00
Matan Lurey
bc84a70c7f Move most of the dart:ui tests to package:test. (flutter/engine#55090)
Work towards https://github.com/flutter/flutter/issues/133569.

There are a couple with custom matchers I'd like to migrate in a follow-up PR.
2024-09-11 23:46:07 +00:00