| Summary: | [Cairo] Add support for premultiplied alpha interpolated color stop gradients in the Cairo backend | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | aperez, Hironori.Fujii, rbuis, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Sam Weinig
2021-12-22 09:40:34 PST
AFAIU, with Cairo we set the colors for the stops un-premultiplied (because there is no other option, that's what the public API allows), then Cairo pre-multiplies color values while building its internal state, then internally always does calculations using premultiplied values, meaning that when painting a gradient it will interpolate stop colors which are premultiplied — there is no way of telling Cairo to calculate interpolaton of gradient stops un-premultiplied. Meaning: with Cairo the way it paints gradiants the output is correct for CSS, but not SVG/Canvas. (Take this with some big grains of salt, I am not a graphics expert, what I *think* know is from looking sometimes inside Cairo in the last months.) (In reply to Adrian Perez from comment #1) > Meaning: with Cairo the way it paints gradiants the output > is correct for CSS, but not SVG/Canvas. Is this right? fast/gradients/alpha-premultiplied.html is failing for Cairo ports. This is not a test case for SVG or Canvas. |