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] Port longpathdash test case from Skia #370

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

armansito
Copy link
Collaborator

This is a single very long path that results in a large number of line segments when dashing is applied. This demonstrates rendering artifacts.

This is a single very long path that results in a large number of
line segments when dashing is applied. This demonstrates rendering
artifacts.
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

I've not had a chance to run this yet - can you include a screenshot?

@@ -21,26 +21,21 @@ macro_rules! scene {
function: Box::new($name),
Copy link
Member

Choose a reason for hiding this comment

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

I'd probably express this case (lines 16-22) in terms of the new addition

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@armansito
Copy link
Collaborator Author

I've not had a chance to run this yet - can you include a screenshot?

Yes of course!

This is the expected shape with butt caps:
Correct butt cap

This is the same butt cap render showing artifacts when it's zoomed out:
Butt cap - zoomed out artifacts

This is the same shape with round caps (which increases the line segment count) showing artifacts at a moderate zoom level:
Screenshot 2023-10-11 at 10 18 42 AM

The latter can be fixed by increasing the bump buffer sizes. I'm treating this as a pathological case with a very high memory requirement. The zoomed out case appears regardless of the size of the bump buffers so that's probably a separate issue.

Added a butt cap and round cap variant of the pathological longpathdash
test case. The round caps exhibit the expected increase in the number of
line segments post-flattening, and hence a significant increase in
required GPU memory.

Also added a new `scene!` macro variant for custom test names and
factory functions that return a test function.
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.

Thanks, and also for the cleanup of the scene creation macros. It will be useful to have more examples that stress the buffer sizes, as we make our way through the dynamic memory question.

@armansito armansito merged commit 84fe030 into linebender:main Oct 17, 2023
4 checks passed
@armansito armansito deleted the pr-longpathdash branch October 17, 2023 04:13
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.

3 participants