vello_cpu: use isolated clip layers for non-rect clips - #115
Merged
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#114 made vello_cpu's
push_clip_layeruse the non-isolatedpush_clip_pathfor non-rect clips when single-threaded. That double-counts anti-aliasing where several draws overlap the clip edge: each draw is clipped and blended on its own, so an edge pixel with coverage (a) ends up at (1-(1-a)^n). With an isolated layer, the content is drawn at full strength and the edge is anti-aliased once, when the layer is composited.It shows up as a WPT regression in Blitz:
css/css-masking/clip-path/clip-path-fillBox-1a.html(background, border and SVG content all overlap theclip-path: circle()edge; edge pixel 84 instead of 145, 364 px outside the fuzzy tolerance).push_clip_rect. That is what newly passes 4 Blitz WPT tests (abspos-overflow-010, the twocolor-scheme-iframe-background-mismatch-*tests,fractional-scale-gradient-bg-obscure-red-bg), which were 1/255 off when rect clips went through a layer.is_multi_threaded()branch is gone.overlapping_fills_in_path_clip_are_antialiased_oncechecks that 3 overlapping fills under a circle clip render the same as 1. It fails withpush_clip_path.vello_hybrid / WebGL still use
push_clip_pathfor non-rect clips and have the same edge behaviour. Whether to isolate those is a separate question, because it needs a GPU benchmark.Testing
cargo clippy --workspace --all-targets -D warnings.cargo test -p anyrender_vello_cpu, with and withoutmultithreading.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/45dbc6c083354777aaa43442ce8ef8ab
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/45dbc6c083354777aaa43442ce8ef8ab?variant=devin-insiders
Requested by: @nicoburns