-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reland "Update all uses of mutable SkPath methods to use SkPathBuilder" #178142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reland "Update all uses of mutable SkPath methods to use SkPathBuilder" #178142
Conversation
…er#177738) Skia is removing the APIs that allow changing an SkPath. This updates those callsites to use SkPathBuilder where appropriate. ## 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], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] 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. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [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
…ut path using SkPathBuilder::operator= addPath does not copy all of the needed attributes of the source path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the codebase to use SkPathBuilder instead of mutable SkPath methods, aligning with modern Skia practices. The changes are extensive and consistently applied across the display list, Impeller, UI, and tools code. The fix in tools/path_ops to correctly handle path attributes during Op is also noted and appears correct. I have reviewed the changes and found no issues.
| SkPath p1 = one->snapshot(); | ||
| SkPath p2 = two->snapshot(); | ||
| if (std::optional<SkPath> result = Op(p1, p2, op)) { | ||
| *one = result.value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use the explicit SkPathBuilder constructor here so we don't hide the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkPathBuilder has an implementation of operator= that takes an SkPath - this is not implicitly constructing an SkPathBuilder.
…10433) Manual roll requested by [email protected] flutter/flutter@ee23168...c3f2704 2025-11-08 [email protected] Roll Dart SDK from cf69b162e2eb to 34902d333e4d (19 revisions) (flutter/flutter#178183) 2025-11-07 [email protected] Roll Skia from 513b15b675f5 to 38d87df93572 (5 revisions) (flutter/flutter#178179) 2025-11-07 [email protected] [ Tool ] Ignore invalid UTF-8 from ADB's stdout (flutter/flutter#178170) 2025-11-07 [email protected] Roll Skia from 581d1ecd5029 to 513b15b675f5 (1 revision) (flutter/flutter#178165) 2025-11-07 [email protected] Reland "Update all uses of mutable SkPath methods to use SkPathBuilder" (flutter/flutter#178142) 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
…r" (flutter#178142) This is a reland of flutter#177738 with a fix to the `Op` function in `tools/path_ops`. To match the previous behavior, `Op` will use `SkPathBuilder::operator=` to copy the result path so that attributes like the fill type will be copied. --------- Co-authored-by: Kaylee Lubick <[email protected]>
…r" (flutter#178142) This is a reland of flutter#177738 with a fix to the `Op` function in `tools/path_ops`. To match the previous behavior, `Op` will use `SkPathBuilder::operator=` to copy the result path so that attributes like the fill type will be copied. --------- Co-authored-by: Kaylee Lubick <[email protected]>
This is a reland of #177738 with a fix to the
Opfunction intools/path_ops.To match the previous behavior,
Opwill useSkPathBuilder::operator=to copy the result path so that attributes like the fill type will be copied.