Skip to content

vello_cpu: use isolated clip layers for non-rect clips - #115

Merged
nicoburns merged 1 commit into
mainfrom
devin/1791060971-vello-cpu-isolated-path-clips
Oct 3, 2026
Merged

nicoburns merged 1 commit into
mainfrom
devin/1791060971-vello-cpu-isolated-path-clips

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Summary

#114 made vello_cpu's push_clip_layer use the non-isolated push_clip_path for 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 the clip-path: circle() edge; edge pixel 84 instead of 145, 364 px outside the fuzzy tolerance).

// push_clip_layer, vello_cpu
if let Some(rect) = clip.as_rect() { push_clip_rect(&rect) }   // unchanged; pop_clip
else                               { push_clip_layer(&path) }  // was: push_clip_path when !is_multi_threaded()
  • Rect clips keep push_clip_rect. That is what newly passes 4 Blitz WPT tests (abspos-overflow-010, the two color-scheme-iframe-background-mismatch-* tests, fractional-scale-gradient-bg-obscure-red-bg), which were 1/255 off when rect clips went through a layer.
  • Same behaviour with and without threads. vello_cpu now renders the same whether multi-threaded or not, so the is_multi_threaded() branch is gone.
  • New test: overlapping_fills_in_path_clip_are_antialiased_once checks that 3 overlapping fills under a circle clip render the same as 1. It fails with push_clip_path.

vello_hybrid / WebGL still use push_clip_path for non-rect clips and have the same edge behaviour. Whether to isolate those is a separate question, because it needs a GPU benchmark.

Testing

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

@staging-devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns merged commit 13b9894 into main Oct 3, 2026
9 checks passed
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.

1 participant