[web] Refactor LazyPath and separate immutable paths from path builders#177686
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring of the path handling logic in the web engine. By separating the mutable path builder from the immutable path object, the new API is cleaner and more robust. The changes are consistently applied across both the CanvasKit and Skwasm backends, including updates to the relevant tests. I've identified a couple of high-severity issues in the LazyPath implementation related to resource management and potential mutation bugs that should be addressed.
eyebrowsoffire
left a comment
There was a problem hiding this comment.
This is looking great so far!
|
|
||
| DisposablePathConstructors constructors; | ||
| DisposablePath Function() initializer; | ||
| DisposablePathBuilder Function() initializer; |
There was a problem hiding this comment.
I think you might be able to just remove this completely, since you've simplified the factory constructors.
There was a problem hiding this comment.
It's still used by LazyPath.combined().
We may be able to remove it if we introduce a CombinePathsCommand? I'll see if that's doable.
There was a problem hiding this comment.
Please look at my attempt to remove initializer here: 9c095eb
I don't think it's an improvement, but let me know what you think.
a104fb2 to
9c095eb
Compare
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Greetings from stale PR triage! 👋 |
1 similar comment
|
Greetings from stale PR triage! 👋 |
|
Still on my radar. Will pick it up soon. |
d21c6f2 to
7adf8c2
Compare
7adf8c2 to
d4e38c0
Compare
flutter/flutter@bf18e39...2fa45e0 2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395) 2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952) 2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930) 2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929) 2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921) 2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911) 2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904) 2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899) 2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887) 2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555) 2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295) 2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886) 2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835) 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 boetger@google.com,stuartmorgan@google.com 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
…rs (flutter#177686) - `CkPath`: - An immutable Path backed by the immutable `SkPath`. - Not exposed to Flutter. - `CkPathBuilder`: - A path builder backed by `SkPathBuilder`. - Not exposed to Flutter. - `SkwasmPath`: - Implements both the immutable path interface and the path builder interface. - Not exposed to Flutter. - `LazyPath`: - The only implementation of the mutable `ui.Path` interface. - Exposed to Flutter. - Manages the lifecycles of renderer-specific paths and path builders.
|
@mdebbar is there a reason why this did not make it to flutter 3.44.0 or was it because the stable was cut before this commit landed ? |
…r#11497) flutter/flutter@bf18e39...2fa45e0 2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395) 2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952) 2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930) 2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929) 2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921) 2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911) 2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904) 2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899) 2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887) 2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555) 2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295) 2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886) 2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835) 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 boetger@google.com,stuartmorgan@google.com 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
…r#11497) flutter/flutter@bf18e39...2fa45e0 2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395) 2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952) 2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930) 2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929) 2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921) 2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917) 2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911) 2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788) 2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904) 2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899) 2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686) 2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887) 2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555) 2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295) 2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886) 2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835) 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 boetger@google.com,stuartmorgan@google.com 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
CkPath:SkPath.CkPathBuilder:SkPathBuilder.SkwasmPath:LazyPath:ui.Pathinterface.