Skip to content

Add support for non-isolated blending in vello_cpu#1159

Merged
LaurenzV merged 8 commits intomainfrom
non_isolated_blend
Oct 30, 2025
Merged

Add support for non-isolated blending in vello_cpu#1159
LaurenzV merged 8 commits intomainfrom
non_isolated_blend

Conversation

@LaurenzV
Copy link
Copy Markdown
Collaborator

I also removed the blend optimization since IMO it causes more troubles than it brings benefits.

Reference images match the ones in tiny-skia.

@LaurenzV LaurenzV requested a review from sagudev August 13, 2025 10:36
Copy link
Copy Markdown
Contributor

@sagudev sagudev left a comment

Choose a reason for hiding this comment

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

I am testing this on servo WPT and I did a quick look. I think this should be reviewed by someone with deeper understanding of sparse strips.

Comment thread sparse_strips/vello_cpu/src/render.rs
@sagudev

This comment was marked as outdated.

@sagudev
Copy link
Copy Markdown
Contributor

sagudev commented Aug 14, 2025

New proper results: https://github.com/sagudev/servo/actions/runs/16947826831/attempts/1#summary-48036644654.
So while canvas has actually isolated blending, this PR allows us to use less layers (more perf) and properly respect clipping.

We should still fix #1119 to match Vello classic.

@nicoburns nicoburns added the C-cpu Applies to the vello_cpu crate label Aug 15, 2025
@LaurenzV
Copy link
Copy Markdown
Collaborator Author

@sagudev Do you think you would have time to do a high-level review and approve if it looks okay? Otherwise I feel like this PR will remain in limbo forever. 😄 It's not that big of a change so I don't think landing this should cause any trouble, especially since existing blending tests work just fine.

@sagudev sagudev self-requested a review October 30, 2025 10:43
Copy link
Copy Markdown
Contributor

@sagudev sagudev left a comment

Choose a reason for hiding this comment

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

Looks alright from higher perspective.

@LaurenzV LaurenzV enabled auto-merge October 30, 2025 21:54
@LaurenzV LaurenzV added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 186106e Oct 30, 2025
17 checks passed
@LaurenzV LaurenzV deleted the non_isolated_blend branch October 30, 2025 22:09
self.reset_paint_transform();
#[cfg(feature = "text")]
self.glyph_caches.as_mut().unwrap().maintain();
self.blend_mode = BlendMode::new(Mix::Normal, Compose::SrcOver);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldn't use BlendMode::default() consistently in here and other places?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Nope, because right now the default is Mix::Clip which I want to avoid using.

Copy link
Copy Markdown
Contributor

@sagudev sagudev Oct 31, 2025

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh! I guess we can change it then!

@grebmeg
Copy link
Copy Markdown
Collaborator

grebmeg commented Nov 12, 2025

Hi @LaurenzV, would you mind updating the CHANGELOG.md files in both vello_common and vello_cpu to reflect the recent updates? It’ll ensure everything is documented properly before release. Really appreciate it! 🙏

@LaurenzV
Copy link
Copy Markdown
Collaborator Author

Oh yeah sure, will try to do that soon!

@LaurenzV
Copy link
Copy Markdown
Collaborator Author

I opened a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cpu Applies to the vello_cpu crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants