refactor(web): Unify ui.Path code for CanvasKit and Skwasm#187331
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Web UI path implementation by renaming 'LazyPath' to 'EnginePath' and replacing 'DisposablePath' abstractions with 'BackendPath' equivalents. It structures these path and path metric abstractions into new files under 'engine/primitives' and 'engine/backend'. Feedback indicates that a temporary backup file 'path_metrics.dart.orig' was committed and should be deleted.
|
autosubmit label was removed for flutter/flutter/187331, because - The status or check suite Linux linux_fuchsia_tests has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/flutter/187331, because - The status or check suite Linux linux_fuchsia_tests has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…11832) Manual roll requested by [email protected] flutter/flutter@701665b...2ba5420 2026-06-03 [email protected] Roll Packages from 818b310 to b11504f (8 revisions) (flutter/flutter#187511) 2026-06-03 [email protected] Add new file patterns for team-web labeler (flutter/flutter#187397) 2026-06-03 [email protected] Roll Skia from 279b17fe9fc1 to d625048c853a (12 revisions) (flutter/flutter#187483) 2026-06-03 [email protected] [SwiftPM] Fix prefer_initializing_formals lint (flutter/flutter#187502) 2026-06-03 [email protected] Roll Fuchsia Linux SDK from q27k7_um1GvVrySZS... to ap7MhLX4TdpWRrLS_... (flutter/flutter#187478) 2026-06-03 [email protected] [SwiftPM] Fix concurrent directory/file/symlink creation crashes (flutter/flutter#186953) 2026-06-03 [email protected] [Impeller] Fix positioning of text shadow masks (flutter/flutter#187460) 2026-06-02 [email protected] Remove Material imports from painting tests (flutter/flutter#186937) 2026-06-02 [email protected] Add android_hardware_smoke_test integration tests (flutter/flutter#187130) 2026-06-02 [email protected] Roll pub packages (flutter/flutter#187471) 2026-06-02 [email protected] [flutter tool] propagate analytics env to sub-tools (flutter/flutter#186780) 2026-06-02 [email protected] Adds macro for fragment shaders to support flutter <= 3.44 (flutter/flutter#187316) 2026-06-02 [email protected] Small clean-up in different java files under `engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/` (flutter/flutter#186631) 2026-06-02 [email protected] refactor(web): Unify ui.Path code for CanvasKit and Skwasm (flutter/flutter#187331) 2026-06-02 [email protected] Roll Packages from f5d50ca to 818b310 (2 revisions) (flutter/flutter#187441) 2026-06-02 [email protected] Allow selecting multi-digit device options (flutter/flutter#186184) 2026-06-02 [email protected] Improve error message for type mismatch in Navigator.pop and maybePop. (flutter/flutter#186571) 2026-06-02 [email protected] Remove semantics_tester import from material_button_test.dart (flutter/flutter#184807) 2026-06-02 [email protected] [flutter_tools] Refactor hostPlatform to use Abi.current() (flutter/flutter#185369) 2026-06-02 [email protected] Clean up avoid_type_to_string suppressions (flutter/flutter#186869) 2026-06-02 [email protected] Update Flutter documentation links in flutter_console.bat (flutter/flutter#187354) 2026-06-02 [email protected] Revert "[Impeller] Allow attaching specific texture mip levels and slices" (flutter/flutter#187445) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#11832) Manual roll requested by [email protected] flutter/flutter@701665b...2ba5420 2026-06-03 [email protected] Roll Packages from 818b310 to b11504f (8 revisions) (flutter/flutter#187511) 2026-06-03 [email protected] Add new file patterns for team-web labeler (flutter/flutter#187397) 2026-06-03 [email protected] Roll Skia from 279b17fe9fc1 to d625048c853a (12 revisions) (flutter/flutter#187483) 2026-06-03 [email protected] [SwiftPM] Fix prefer_initializing_formals lint (flutter/flutter#187502) 2026-06-03 [email protected] Roll Fuchsia Linux SDK from q27k7_um1GvVrySZS... to ap7MhLX4TdpWRrLS_... (flutter/flutter#187478) 2026-06-03 [email protected] [SwiftPM] Fix concurrent directory/file/symlink creation crashes (flutter/flutter#186953) 2026-06-03 [email protected] [Impeller] Fix positioning of text shadow masks (flutter/flutter#187460) 2026-06-02 [email protected] Remove Material imports from painting tests (flutter/flutter#186937) 2026-06-02 [email protected] Add android_hardware_smoke_test integration tests (flutter/flutter#187130) 2026-06-02 [email protected] Roll pub packages (flutter/flutter#187471) 2026-06-02 [email protected] [flutter tool] propagate analytics env to sub-tools (flutter/flutter#186780) 2026-06-02 [email protected] Adds macro for fragment shaders to support flutter <= 3.44 (flutter/flutter#187316) 2026-06-02 [email protected] Small clean-up in different java files under `engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/` (flutter/flutter#186631) 2026-06-02 [email protected] refactor(web): Unify ui.Path code for CanvasKit and Skwasm (flutter/flutter#187331) 2026-06-02 [email protected] Roll Packages from f5d50ca to 818b310 (2 revisions) (flutter/flutter#187441) 2026-06-02 [email protected] Allow selecting multi-digit device options (flutter/flutter#186184) 2026-06-02 [email protected] Improve error message for type mismatch in Navigator.pop and maybePop. (flutter/flutter#186571) 2026-06-02 [email protected] Remove semantics_tester import from material_button_test.dart (flutter/flutter#184807) 2026-06-02 [email protected] [flutter_tools] Refactor hostPlatform to use Abi.current() (flutter/flutter#185369) 2026-06-02 [email protected] Clean up avoid_type_to_string suppressions (flutter/flutter#186869) 2026-06-02 [email protected] Update Flutter documentation links in flutter_console.bat (flutter/flutter#187354) 2026-06-02 [email protected] Revert "[Impeller] Allow attaching specific texture mip levels and slices" (flutter/flutter#187445) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…87331) This is the first in a series of PRs to unify the `dart:ui` primitive types for the two backends. The rough plan is to have 4 layers of objects for the primitives. 1. `dart:ui` types: these are the types in `dart:ui` like `Path`, `Paint`, `Picture`, etc. 2. `Engine`-prefixed types: these are the concrete implementations of the `dart:ui` types, but with extra web-specific logic. For instance, they know that they are backed objects in WASM memory, and are responsible for disposing those objects. They are backed by `Backend`-prefixed types. 3. `Backend`-prefixed types: these are the types that the backends (CanvasKit and Skwasm) actually implement. 4. The `Sk` (or `Dl`) types in WASM. These are the actual Skia or DisplayList types. The end goal is that the `Backend` types are a bare minimum API that just forward method calls directly to the underlying WASM objects. The Web engine will handle things like memory management, platform views, etc. I started with `Path` because the `LazyPath` code was already mostly unified, and was a "leaf" node in the Skia object hierarchy. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. Starts towards flutter#175630 <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

This is the first in a series of PRs to unify the
dart:uiprimitive types for the two backends.The rough plan is to have 4 layers of objects for the primitives.
dart:uitypes: these are the types indart:uilikePath,Paint,Picture, etc.Engine-prefixed types: these are the concrete implementations of thedart:uitypes, but with extra web-specific logic. For instance, they know that they are backed objects in WASM memory, and are responsible for disposing those objects. They are backed byBackend-prefixed types.Backend-prefixed types: these are the types that the backends (CanvasKit and Skwasm) actually implement.Sk(orDl) types in WASM. These are the actual Skia or DisplayList types.The end goal is that the
Backendtypes are a bare minimum API that just forward method calls directly to the underlying WASM objects. The Web engine will handle things like memory management, platform views, etc.I started with
Pathbecause theLazyPathcode was already mostly unified, and was a "leaf" node in the Skia object hierarchy.Pre-launch Checklist
///).Starts towards #175630