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

Additional test cases for co-linear stroked curves #453

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

armansito
Copy link
Collaborator

Ported over some additional test cases from Skia's "tricky cubic strokes" tests that exercise co-linear quadratic curves. These used to render incorrectly until the recent kurbo update, so it's good to have these in Vello.

These new curves are technically conic sections with cusps in them (with weights 1, 0.3, and 1.5). Vello doesn't yet support rational Beziers, so Skia encodes a conic as a path composed of quadratics (with a tolerance of 0.25 which scaled by the applied transform). The new test cases encode the results of this conic->quad conversion.

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.

Presuming that there are no licensing issues with these, and a resolution for the going offscreen question

I haven't really reviewed what the tests are achieving, but they all render the same on CPU and GPU, and the new tests appear.

path.push(QuadTo(quad[0].into(), quad[1].into()));
}
let x = (idx % NUM_COLS) as f64 * CELL_SIZE;
let y = (idx / NUM_COLS) as f64 * CELL_SIZE;
Copy link
Member

Choose a reason for hiding this comment

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

These now go off screen at the default window size

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can adjust the CELL_SIZE to adapt to the number of rows (which fixes this on my external monitor).

The layout in general is sensitive to DPI, e.g. at the default window dimensions, everything fits and looks tiny on my MacBook's retina display, but enlarged on my external monitor. I've observed this with all the other test scenes too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test scene now initializes the resolution field of SceneParams, which fixes the issue for me.

@xStrom
Copy link
Member

xStrom commented Feb 26, 2024

We have a new Android CI check so you'll need to rebase on main to get that to pass.

@armansito armansito force-pushed the more-flat-stroke-tests branch from 261b748 to cdd3381 Compare February 28, 2024 21:48
@armansito armansito enabled auto-merge February 28, 2024 21:50
@armansito armansito added this pull request to the merge queue Feb 28, 2024
Merged via the queue into main with commit f164ffc Feb 28, 2024
9 checks passed
@armansito armansito deleted the more-flat-stroke-tests branch February 28, 2024 22:28
@DJMcNab DJMcNab mentioned this pull request Mar 1, 2024
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