Looking to accomplish "reverse" clip
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
In skia for instance, it's possible to accomplish a reverse clip meaning that the clip area is not used as an intersection, but as a subtraction instead. This is useful when trying to accomplish more graphical features such as rendering strokes with outside alignment (default is centered, inner alignment can be accomplished by doubling the stroke width and using the shape as clip shape, but outer alignment requires inverse clipping). I have tried without success to accomplish this in piet. Is this something we can add? Can this be done by allowing the clip shape to use an even-odd fill rule? I am using druid on windows so I assume I am using the d2d backend. It specifies nonzero as fill rule which seems wrong.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing piet's clip API and the d2d backend used by Druid on Windows, then compare its nonzero fill-rule handling with Skia's reverse clip behavior. Check whether an even-odd fill rule is exposed and how clipping is represented across backends. Done means inverse clipping supports the requested outside-aligned stroke use case without breaking existing clipping behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100