Skip to content
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

[test_scenes] Tests scenes for strokes #388

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

armansito
Copy link
Collaborator

@armansito armansito commented Oct 17, 2023

Added two new test scenes that exercise stroke styles and some edge conditions:

  1. stroke_styles: Renders a combination of cap and join styles

  2. tricky_strokes: Renders cubic strokes that demonstrate certain edge conditions, such as cusps and co-linear control points. Several of these tests are commented out as they trigger an infinite recursion in the kurbo curve fitting logic and crash the example.

These should probably get copied as unit tests in kurbo as part of a fix for the infinite recursions.

@armansito armansito requested review from raphlinus and dfrg October 17, 2023 04:16
@armansito armansito force-pushed the pr-stroke-tests branch 2 times, most recently from 418d897 to 836a33a Compare October 17, 2023 15:45
Added two new test scenes that exercise stroke styles and some edge
conditions:

1. stroke_styles: Renders a combination of cap and join styles

2. tricky_strokes: Renders cubic strokes that demonstrate certain edge
   conditions, such as cusps and co-linear control points. Several of
   these tests are commented out as they trigger an infinite recursion
   in the kurbo curve fitting logic and crash the example.

These should probably get copied as unit tests in kurbo as part of a fix
for the infinite recursions.
Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful cases, thanks!

All the broken_cubic cases are fixed by kurbo#318, and I've included those in a test. Additionally, the artifact that appears is a numerical robustness issue that was fixed in msaa fine but not yet ported to the area aa. This can be done as an isolated patch, but I'm also tempted to switch the segment storage from 24 to 8 bytes and fold the change into that; the msaa is already written in that style and does not read the y_edge value, so making that change would get rid of some duplicated logic overlapping the robustness concern.

@armansito armansito merged commit a295371 into linebender:main Oct 19, 2023
4 checks passed
@armansito armansito deleted the pr-stroke-tests branch October 19, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants