-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Fixes stroke path geometry that can draw outside of path if the path ends at sharp turn. #45252
Conversation
47a0133
to
018c24d
Compare
builder.AddArc(rect, Degrees(0), Degrees(90), false); | ||
|
||
canvas.DrawPath(builder.TakePath(), paint); | ||
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); |
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.
I am not too familiar with the code, let me know if this is enough to set up golden test.
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.
Yup, this is the correct way to add a golden. 👍
vtx.position = polyline.points[point_i - 1] + offset; | ||
vtx_builder.AppendVertex(vtx); | ||
vtx.position = polyline.points[point_i - 1] - offset; | ||
vtx_builder.AppendVertex(vtx); | ||
vtx.position = polyline.points[point_i] + offset; |
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.
This was where the complete rect is drawn. This part is now handle by the join when then draw the first pair of inner miter point and outer
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. |
oops looks like the golden has failed |
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. |
7b9dc01
to
bff1fa2
Compare
Golden file changes are available for triage from new commit, Click here to view. |
bff1fa2
to
8e4f30d
Compare
Golden file changes are available for triage from new commit, Click here to view. |
The circle golden is missing a tiny tiny slide of pixels which i think won't affect the real world pixel, but let me know if this is a problem @bdero This is ready for review now |
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.
LGTM but @bdero is more familiar with this code and may have thoughts.
Thanks so much!
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.
This patch introduces regressions with most strokes (visible in EntityTest.StrokeCapAndJoinTest).
Screen.Recording.2023-09-05.at.12.01.38.PM.mov |
8023852
to
87a0e2d
Compare
I also added a new golden test that similar to the cubic component playground |
Golden file changes are available for triage from new commit, Click here to view. |
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.
EntityTest.StrokeCapAndJoinTest
still doesn't look right. This is the line I use to build and run it:
autoninja -C ../out/host_debug_unopt/ -j 1000 flutter/impeller:impeller_unittests && ../out/host_debug_unopt/impeller_unittests --timeout=0 --gtest_filter="Play/EntityTest.StrokeCapAndJoinTest/Metal" --enable_playground
Ah hold on one sec, I think I screwed up the checkout locally. |
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.
LGTM! Thanks a lot for your work on this! :)
The goldens are looking good and I marked them as positive. |
… of path if the path ends at sharp turn. (flutter/engine#45252)
… of path if the path ends at sharp turn. (flutter/engine#45252)
…134683) flutter/engine@b71b366...154d6fd 2023-09-13 [email protected] Auto update dependencies for web_ui. (flutter/engine#45754) 2023-09-13 [email protected] Revert "[Impeller] Patch the compiler to account for subpass inputs and PSO metadata." (flutter/engine#45777) 2023-09-13 [email protected] Roll Skia from 471216072c74 to e39cf360ea93 (4 revisions) (flutter/engine#45776) 2023-09-13 [email protected] [Impeller] Remove dependency on //flutter/vulkan and use a single proc table. (flutter/engine#45741) 2023-09-13 [email protected] Roll Skia from 78d18d509475 to 471216072c74 (4 revisions) (flutter/engine#45774) 2023-09-13 [email protected] [Impeller] Fixes stroke path geometry that can draw outside of path if the path ends at sharp turn. (flutter/engine#45252) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…f path if the path ends at sharp turn. (flutter#45252)" This reverts commit 343dfe8.
#46334) �f path if the path ends at sharp turn. (#45252)" This reverts commit 343dfe8. introduced a regression flutter/flutter#135225 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
…lutter#134683) flutter/engine@b71b366...154d6fd 2023-09-13 [email protected] Auto update dependencies for web_ui. (flutter/engine#45754) 2023-09-13 [email protected] Revert "[Impeller] Patch the compiler to account for subpass inputs and PSO metadata." (flutter/engine#45777) 2023-09-13 [email protected] Roll Skia from 471216072c74 to e39cf360ea93 (4 revisions) (flutter/engine#45776) 2023-09-13 [email protected] [Impeller] Remove dependency on //flutter/vulkan and use a single proc table. (flutter/engine#45741) 2023-09-13 [email protected] Roll Skia from 78d18d509475 to 471216072c74 (4 revisions) (flutter/engine#45774) 2023-09-13 [email protected] [Impeller] Fixes stroke path geometry that can draw outside of path if the path ends at sharp turn. (flutter/engine#45252) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
#46334) �f path if the path ends at sharp turn. (#45252)" This reverts commit 343dfe8. introduced a regression flutter/flutter#135225 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Fixes flutter/flutter#133032
The issue is that when we draw a line we always try to draw a complete rectangle from point 1 to point2 before drawing the join and the next line

This becomes a problem if there is a sharp turn

Notice there will be a slight over drawing at the bottom.
The solution then is to not draw the rect first before drawing the join. It will be the join's responsibility to draw the complete the rect from the line start to the join.
This should also save a lot of repeatedly drawing during the join

Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.