sparse_strips: Move some code from vello_cpu to vello_common#1744
sparse_strips: Move some code from vello_cpu to vello_common#1744LaurenzV wants to merge 9 commits into
vello_cpu to vello_common#1744Conversation
| // This struct implements an additional piece of logic to make non-isolated clips work properly | ||
| // with filter layers. The root of all "evil" that requires us to implement this wrapper around | ||
| // [`crate::clip::ClipContext`] is that, as the user pushes new filter layers into the | ||
| // render context, we eagerly apply a shift to all subsequently rendered contents to ensure that | ||
| // everything necessary for correct filter rendering is guaranteed to be visible. However, since | ||
| // the clip stack eagerly generates strips for each clip path that is clipped to the original | ||
| // viewport, those generated clip paths cannot just be translated on demand to account for the | ||
| // source shift of the filter layer. Therefore, every time a new filter layer is pushed, we need | ||
| // to regenerate the clip context for that specific layer to ensure clips are applied correctly. | ||
| /// State for managing clip paths across multiple viewports. |
There was a problem hiding this comment.
This was slightly rewritten from the original doc comment.
8806e12 to
a93be43
Compare
| //! Note: The description below was written with Vello CPU in mind, but also applies to Vello | ||
| //! Hybrid, except that Vello Hybrid does not perform bucketing. |
There was a problem hiding this comment.
Is this disclaimer worth it? Could we instead just update the comments wherever the behavior differs? Otherwise, it adds extra mental overhead and distracts from the purpose of vello_common as the shared place for code used by both renderers.
|
Btw, it might be worth keeping this branch (or maybe |
This is the first PR in a series of three (perhaps four) PRs that serve as a preparation for the Vello Hybrid rewrite.
This PR is easiest reviewed commit by commit, though there isn't that much to review in the first place. Apart from adjusting a few descriptions, it's mostly just moving some code around.
The first 7 commits were done by manually copy-pasting code into the right location. The last commit that fixes compiler issues were done with AI assistance.
PR train
vello_cputovello_common#1744 — Move some code fromvello_cputovello_common👈vello_common#1745 — Add more new/refactored code intovello_commonPaddingtype and streamline clip handling #1751 — IntroducePaddingand streamline clip handling