Fix unintentionally joined path contours#187522
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates StrokePathSegmentReceiver::BeginContour to append glue vertices when starting a new contour, regardless of whether the new contour's origin matches the last point of the prior contour. This ensures that segments in different contours are not unintentionally joined. It also corrects coordinate comments in existing tests and adds a new unit test to verify that line segments in different contours remain separated. No review comments were provided, and there is no feedback to address.
| // |SegmentReceiver| | ||
| void BeginContour(Point origin, bool will_be_closed) override { | ||
| if (has_prior_contour_ && origin != last_point_) { | ||
| if (has_prior_contour_) { |
There was a problem hiding this comment.
The only question I would have is whether we need all 4 of these vertices if the 2 points are the same, but it shouldn't hurt anything I don't think?
There was a problem hiding this comment.
I think if the 2 points are the same, we only need 2 extra vertices instead of all 4. But like you said, I don't think it hurts to have 4. And I like that this keeps the code more consistent and simpler with no extra branching for the same vs different cases.
| { | ||
| .width = 10.0f, | ||
| .cap = Cap::kButt, | ||
| .join = Join::kBevel, |
There was a problem hiding this comment.
I would do a golden test of this case with all 3 join types.
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. 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. |
Roll Flutter from 2ba5420a7049 to 1bdf4af29076 (43 revisions) flutter/flutter@2ba5420...1bdf4af 2026-06-05 [email protected] Roll Packages from 03352b5 to 61bdbb4 (5 revisions) (flutter/flutter#187612) 2026-06-05 [email protected] Roll Skia from 6e003d7f69c8 to a47a9a2c8ae5 (1 revision) (flutter/flutter#187610) 2026-06-05 [email protected] Roll Dart SDK from aad8be4ce307 to 6a9a0efe66eb (10 revisions) (flutter/flutter#187609) 2026-06-05 [email protected] Roll Skia from 494f1bf55f51 to 6e003d7f69c8 (2 revisions) (flutter/flutter#187607) 2026-06-05 [email protected] Roll Fuchsia Linux SDK from ZE1Jy9CtVVi-tjBAE... to N_LiSaBSUsE2LDZgG... (flutter/flutter#187597) 2026-06-05 [email protected] Roll Skia from 59556fdb8c33 to 494f1bf55f51 (2 revisions) (flutter/flutter#187596) 2026-06-04 [email protected] Roll Skia from 8eb107046fd5 to 59556fdb8c33 (1 revision) (flutter/flutter#187590) 2026-06-04 [email protected] Remove `embedded_android_views_integration_test.dart` (flutter/flutter#187465) 2026-06-04 [email protected] Remove Material imports from rendering editable tests (flutter/flutter#186951) 2026-06-04 [email protected] [Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor (flutter/flutter#187477) 2026-06-04 [email protected] [iOS] Eliminate unnecessary redeclaration of FlutterDisplayLink (flutter/flutter#187557) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187583) 2026-06-04 [email protected] Log stdout in adb.dart (flutter/flutter#187531) 2026-06-04 [email protected] Clarify RouterDelegate popRoute bubbling (flutter/flutter#186875) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187584) 2026-06-04 [email protected] Add updating-android-sdk agent skill for rolling Android SDK in CIPD (flutter/flutter#187576) 2026-06-04 [email protected] Fixing alignment issue (flutter/flutter#187518) 2026-06-04 [email protected] [Material Cross Imports] Clean up Material Divider usages (flutter/flutter#187300) 2026-06-04 [email protected] Roll Skia from cecc0e0da9ae to 928ded2a31af (6 revisions) (flutter/flutter#187574) 2026-06-04 [email protected] Use swift demangle to verify internal Swift symbols (flutter/flutter#186835) 2026-06-04 [email protected] Add android 37 platform and build tools to script for android cipd bundle creation (flutter/flutter#187571) 2026-06-04 [email protected] [Impeller] Increase the precision of the IPSampleWithTileModeOES coords parameter to match the input coordinates in the tiled_texture_fill_external shader (flutter/flutter#187545) 2026-06-04 [email protected] Roll Packages from b11504f to 03352b5 (4 revisions) (flutter/flutter#187569) 2026-06-04 [email protected] Roll Dart SDK to Dart 3.13 beta2 (flutter/flutter#187555) 2026-06-04 [email protected] Roll Skia from 611e3f8ceb93 to cecc0e0da9ae (1 revision) (flutter/flutter#187562) 2026-06-04 [email protected] Add step to bootstrap Flutter tool in coverage workflow (flutter/flutter#187199) 2026-06-04 [email protected] Roll Skia from 4fdb859c8da7 to 611e3f8ceb93 (4 revisions) (flutter/flutter#187554) 2026-06-04 [email protected] Roll Skia from 0020aae33f63 to 4fdb859c8da7 (2 revisions) (flutter/flutter#187552) 2026-06-04 [email protected] Roll Fuchsia Linux SDK from ap7MhLX4TdpWRrLS_... to ZE1Jy9CtVVi-tjBAE... (flutter/flutter#187550) 2026-06-04 [email protected] Add vector_math to package issue template (flutter/flutter#187536) 2026-06-04 [email protected] Manual roll Dart SDK from d39850bf4a01 to 3b70b98fa7c0 (flutter/flutter#187519) 2026-06-04 [email protected] Roll Skia from d625048c853a to 0020aae33f63 (20 revisions) (flutter/flutter#187539) 2026-06-04 [email protected] [Impeller][Windows] fix black screen on OpenGL fallback (flutter/flutter#187288) 2026-06-04 [email protected] Fix unintentionally joined path contours (flutter/flutter#187522) 2026-06-03 [email protected] fix: resolve issue #177379 by using lazy buildDirectory.dir() API in build.gradle template (flutter/flutter#187127) 2026-06-03 [email protected] Add a skill for flake analysis (flutter/flutter#187530) 2026-06-03 [email protected] adds linux impeller project flag (flutter/flutter#186982) 2026-06-03 [email protected] Add support for stylus buttons (flutter/flutter#183369) 2026-06-03 [email protected] Prevent Cubic transform from looping on out-of-range input (flutter/flutter#185875) 2026-06-03 [email protected] [Impeller] Reland: Allow attaching specific texture mip levels and slices (flutter/flutter#187470) 2026-06-03 [email protected] [skia] Update image deserial proc (flutter/flutter#185041) 2026-06-03 [email protected] docs: update Impeller advanced blend docs for framebuffer fetch (flutter/flutter#185457) 2026-06-03 [email protected] Handle#6537 fifth grouped tests (flutter/flutter#183720) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: ...
…r#11849) Roll Flutter from 2ba5420a7049 to 1bdf4af29076 (43 revisions) flutter/flutter@2ba5420...1bdf4af 2026-06-05 [email protected] Roll Packages from 03352b5 to 61bdbb4 (5 revisions) (flutter/flutter#187612) 2026-06-05 [email protected] Roll Skia from 6e003d7f69c8 to a47a9a2c8ae5 (1 revision) (flutter/flutter#187610) 2026-06-05 [email protected] Roll Dart SDK from aad8be4ce307 to 6a9a0efe66eb (10 revisions) (flutter/flutter#187609) 2026-06-05 [email protected] Roll Skia from 494f1bf55f51 to 6e003d7f69c8 (2 revisions) (flutter/flutter#187607) 2026-06-05 [email protected] Roll Fuchsia Linux SDK from ZE1Jy9CtVVi-tjBAE... to N_LiSaBSUsE2LDZgG... (flutter/flutter#187597) 2026-06-05 [email protected] Roll Skia from 59556fdb8c33 to 494f1bf55f51 (2 revisions) (flutter/flutter#187596) 2026-06-04 [email protected] Roll Skia from 8eb107046fd5 to 59556fdb8c33 (1 revision) (flutter/flutter#187590) 2026-06-04 [email protected] Remove `embedded_android_views_integration_test.dart` (flutter/flutter#187465) 2026-06-04 [email protected] Remove Material imports from rendering editable tests (flutter/flutter#186951) 2026-06-04 [email protected] [Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor (flutter/flutter#187477) 2026-06-04 [email protected] [iOS] Eliminate unnecessary redeclaration of FlutterDisplayLink (flutter/flutter#187557) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187583) 2026-06-04 [email protected] Log stdout in adb.dart (flutter/flutter#187531) 2026-06-04 [email protected] Clarify RouterDelegate popRoute bubbling (flutter/flutter#186875) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187584) 2026-06-04 [email protected] Add updating-android-sdk agent skill for rolling Android SDK in CIPD (flutter/flutter#187576) 2026-06-04 [email protected] Fixing alignment issue (flutter/flutter#187518) 2026-06-04 [email protected] [Material Cross Imports] Clean up Material Divider usages (flutter/flutter#187300) 2026-06-04 [email protected] Roll Skia from cecc0e0da9ae to 928ded2a31af (6 revisions) (flutter/flutter#187574) 2026-06-04 [email protected] Use swift demangle to verify internal Swift symbols (flutter/flutter#186835) 2026-06-04 [email protected] Add android 37 platform and build tools to script for android cipd bundle creation (flutter/flutter#187571) 2026-06-04 [email protected] [Impeller] Increase the precision of the IPSampleWithTileModeOES coords parameter to match the input coordinates in the tiled_texture_fill_external shader (flutter/flutter#187545) 2026-06-04 [email protected] Roll Packages from b11504f to 03352b5 (4 revisions) (flutter/flutter#187569) 2026-06-04 [email protected] Roll Dart SDK to Dart 3.13 beta2 (flutter/flutter#187555) 2026-06-04 [email protected] Roll Skia from 611e3f8ceb93 to cecc0e0da9ae (1 revision) (flutter/flutter#187562) 2026-06-04 [email protected] Add step to bootstrap Flutter tool in coverage workflow (flutter/flutter#187199) 2026-06-04 [email protected] Roll Skia from 4fdb859c8da7 to 611e3f8ceb93 (4 revisions) (flutter/flutter#187554) 2026-06-04 [email protected] Roll Skia from 0020aae33f63 to 4fdb859c8da7 (2 revisions) (flutter/flutter#187552) 2026-06-04 [email protected] Roll Fuchsia Linux SDK from ap7MhLX4TdpWRrLS_... to ZE1Jy9CtVVi-tjBAE... (flutter/flutter#187550) 2026-06-04 [email protected] Add vector_math to package issue template (flutter/flutter#187536) 2026-06-04 [email protected] Manual roll Dart SDK from d39850bf4a01 to 3b70b98fa7c0 (flutter/flutter#187519) 2026-06-04 [email protected] Roll Skia from d625048c853a to 0020aae33f63 (20 revisions) (flutter/flutter#187539) 2026-06-04 [email protected] [Impeller][Windows] fix black screen on OpenGL fallback (flutter/flutter#187288) 2026-06-04 [email protected] Fix unintentionally joined path contours (flutter/flutter#187522) 2026-06-03 [email protected] fix: resolve issue #177379 by using lazy buildDirectory.dir() API in build.gradle template (flutter/flutter#187127) 2026-06-03 [email protected] Add a skill for flake analysis (flutter/flutter#187530) 2026-06-03 [email protected] adds linux impeller project flag (flutter/flutter#186982) 2026-06-03 [email protected] Add support for stylus buttons (flutter/flutter#183369) 2026-06-03 [email protected] Prevent Cubic transform from looping on out-of-range input (flutter/flutter#185875) 2026-06-03 [email protected] [Impeller] Reland: Allow attaching specific texture mip levels and slices (flutter/flutter#187470) 2026-06-03 [email protected] [skia] Update image deserial proc (flutter/flutter#185041) 2026-06-03 [email protected] docs: update Impeller advanced blend docs for framebuffer fetch (flutter/flutter#185457) 2026-06-03 [email protected] Handle#6537 fifth grouped tests (flutter/flutter#183720) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: ...
Fixes a bug where neighboring path contours are incorrectly bevel joined when the end point of one contour coincides with the start point of the next contour. `StrokePathSegmentReceiver::BeginContour` has logic to keep contours separate by adding extra vertices between neighboring contours (referred to as "glue points" in the unit tests). This existing logic does not add these points if the new contour starts at the same point as the end of the old contour (if `origin == last_point_`). This check is incorrect, and we still need these "glue points" when the new contour starts at the end of the old contour. Fixes flutter#186942 ### Screenshots, using the sample app in flutter#186942 #### Before: <img width="912" height="744" alt="Screenshot 2026-06-02 at 4 57 35 PM" src="https://github.com/user-attachments/assets/5c0d03c9-e46e-4985-ba37-5704444fe85e" /> The blue paths (consisting of one line followed by another line added with a subpath) are incorrectly bevel joined. #### After: <img width="912" height="744" alt="Screenshot 2026-06-02 at 5 01 03 PM" src="https://github.com/user-attachments/assets/0611e43a-6d59-4ccb-8313-7da522db48f8" /> The two line segments of the blue paths are not connected with a join. Expected behavior. ### Geometry: #### Before: <img width="564" height="628" alt="Screenshot 2026-06-02 at 4 59 44 PM" src="https://github.com/user-attachments/assets/bded7ff0-8657-48d8-8480-1257d3521937" /> #### After: <img width="588" height="692" alt="Screenshot 2026-06-02 at 4 53 29 PM" src="https://github.com/user-attachments/assets/4e63c6ba-897d-4c47-8b03-26f068d4415e" /> ## 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. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [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


Fixes a bug where neighboring path contours are incorrectly bevel joined when the end point of one contour coincides with the start point of the next contour.
StrokePathSegmentReceiver::BeginContourhas logic to keep contours separate by adding extra vertices between neighboring contours (referred to as "glue points" in the unit tests). This existing logic does not add these points if the new contour starts at the same point as the end of the old contour (iforigin == last_point_). This check is incorrect, and we still need these "glue points" when the new contour starts at the end of the old contour.Fixes #186942
Screenshots, using the sample app in #186942
Before:
The blue paths (consisting of one line followed by another line added with a subpath) are incorrectly bevel joined.
After:
The two line segments of the blue paths are not connected with a join. Expected behavior.
Geometry:
Before:
After:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.