Add mix-blend-mode plus-lighter and feComposite operator=lighter - #1142
Open
matthargett wants to merge 1 commit into
Open
matthargett wants to merge 1 commit into
matthargett wants to merge 1 commit into
Conversation
Both are the Porter-Duff plus operator: plus-lighter (Compositing and Blending Level 2) parses into BlendMode::PlusLighter and feComposite's lighter (SVG 2) into CompositeOperator::Lighter; resvg renders both with tiny_skia::BlendMode::Plus. plus-lighter used to parse as nothing and render normal, lighter fell through to over. Closes linebender#1039.
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.
Adds the two
lighteroperators the browsers ship, for some conformance gaps I ran into while testing femtovg against WPT and a large corpus of SVGs on the public web:mix-blend-mode: plus-lighter(Compositing and Blending Level 2), parsed intousvg::BlendMode::PlusLighterand rendered withtiny_skia::BlendMode::Plus. It used to parse as nothing and rendernormal.feComposite operator="lighter"(SVG 2), parsed intofilter::CompositeOperator::Lighterand applied withPlus. It used to fall through toover. Closes Implementoperator="lighter"for thefeCompositeelement #1039.Both are the Porter-Duff plus operator, so no new blend math; the writer round-trips both, and the SVG 2 changelog and the crate changelog are updated.
Tests:
painting/mix-blend-mode/plus-lighterandfilters/feComposite/operator=lighter, references rendered with this branch. Checked against browsers at the suite's 300 px: thefeCompositereference is pixel-identical to Chromium 131 (Firefox does not implementlighteryet and rendersover); theplus-lighterreference is pixel-identical to Firefox and matches Chromium's blended colour, the two browsers differing only in how they raster the test's gradient.Note for the release:
BlendModeandCompositeOperatorare exhaustive public enums, so the new variants are a breaking change forusvgconsumers that match on them.