COLRv1 radial gradient with zero-length color line and extend-mode:pad renders incorrectly
Categories
(Core :: Graphics: Text, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
Followup to bug 1793105: one more edge-case that isn't handled correctly, even after the patch there, is the case of a "degenerate" color line where all stops are at the same offset.
In the case of repeat modes, such a gradient renders nothing (per spec), because we can't fill space by repeating a zero-length segment no matter how hard we try. But in the case of pad mode, it should simply render the first and last colors, with a hard transition between them.
This currently fails if the stop offset is outside the [0..1] interval, because we bail out of trying to normalize the offsets, and the shader clamps the stop position, so the transition happens in the wrong place. With the color line being zero-length, our code to "project" circle positions based on the normalized color line can't work.
To fix this, we can append an extra "artificial" stop as a copy of the last color stop, but with an increased offset (in pad mode only); this will be subsumed by the pad-extension anyhow, but provides a non-zero-length color line so that we can project the defining circles as needed.
Assignee | ||
Comment 1•2 years ago
|
||
Includes reftest; there's fuzz at the color transitions, when compared to a CSS-backgrounds simulation,
but in the case of "real" failure there'd be many more pixels of mismatch, and max-difference would be 255.
Comment 3•2 years ago
|
||
Backed out for causing reftest failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/8c71321896d0b85f8c452256c25b71673c019039
Failure log: https://treeherder.mozilla.org/logviewer?job_id=392250682&repo=autoland&lineNumber=5957
Assignee | ||
Updated•2 years ago
|
Comment 5•2 years ago
|
||
bugherder |
Description
•