SVG FeFuncA type="table" does not correctly invert opacity, in WebRender
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox-esr68 | --- | disabled |
firefox68 | --- | wontfix |
firefox69 | --- | wontfix |
firefox70 | --- | fixed |
People
(Reporter: michael.mullany, Assigned: tnikkel)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Steps to reproduce:
I created a test case showing 4 rect elements with blue fill at 100%, 75%, 25% and 0% opacity, and applied a filter with feFuncA type="table" tableValues="1 0".
https://codepen.io/mullany/pen/OJLROPb
Actual results:
All shapes with any opacity > 0 were set to 0 opacity
Expected results:
The result should have been four shapes at zero, 25%, 75% and 100% blue filled opacity.
A similar issue occurs with tableValues="0 1" - which should be the identity primitive.
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
(In reply to michael.mullany from comment #0)
Actual results:
All shapes with any opacity > 0 were set to 0 opacity
Can you be more specific about which part (visually) is incorrect?
For me in Firefox nightly on Linux, the testcase renders the same as in Chrome. (First row has 3 fading-shades-of-blue rects and a white rect, and second row has white/lightblue/darkerblue/black)
A guess: if I enable WebRender, I do see something broken -- the bottom row shows the middle two rects as white rather than shades of blue. Is that the problem you're reporting, or is there something else that's wrong as well?
(If that matches the bug you're seeing: could you check whether the bug goes away if you type "about:config" into your URL bar, and then type gfx.webrender.force-disabled
into that page's search box, and double-click that row to set it to true
, and restart Firefox?)
Updated•5 years ago
|
Reporter | ||
Comment 3•5 years ago
|
||
Confirmed - this bug goes away when I force-disable WebRender
(it still doesn't invert a 0% opacity blue square properly (renders black instead of blue - but at least that makes it behave the same as Chrome - and I think merits a separate bug)
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Hey Nical - can you let me know what you think?
Assignee | ||
Comment 5•5 years ago
|
||
Pretty sure this was regressed by bug 1505871. Confirming that now. I'll take a look at this bug.
Comment 6•5 years ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #5)
Pretty sure this was regressed by bug 1505871. Confirming that now. I'll take a look at this bug.
Indeed -- midair'ed.
mozregression --pref gfx.webrender.all:true
tells me the regression range was https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f38de0791ab52be4c8d754e64c5c6a924fc65563&tochange=44192297e3ae55473fbe669a681f937191a54b81
--> regression from bug 1505871
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
It looks like the issue occurs when we unpremultiply the color in the brush_blend shader.
https://searchfox.org/mozilla-central/rev/597a69c70a5cce6f42f159eb54ad1ef6745f5432/gfx/wr/webrender/res/brush_blend.glsl#272
(also needs to be fixed here https://searchfox.org/mozilla-central/source/gfx/wr/webrender/res/cs_svg_filter.glsl#573)
When unpremultiplying we should only divide the rgb components of the color by the alpha, but we were also dividing the alpha by itself which results in the alpha component always being 1 (unless it was originally 0).
Assignee | ||
Comment 8•5 years ago
|
||
(In reply to Connor Brewster [:cbrewster] from comment #7)
It looks like the issue occurs when we unpremultiply the color in the brush_blend shader.
https://searchfox.org/mozilla-central/rev/597a69c70a5cce6f42f159eb54ad1ef6745f5432/gfx/wr/webrender/res/brush_blend.glsl#272
(also needs to be fixed here https://searchfox.org/mozilla-central/source/gfx/wr/webrender/res/cs_svg_filter.glsl#573)
Thanks for the find!
It looks like cs_svg_filter.glsl was already doing the right thing: it computed colora incorrectly, but it never used that variable, instead using the correctly calculated Ca.
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/44b7392be405 In brush_blend.glsl shader don't unpremultiply the alpha, only the colors. r=gw
Comment 11•5 years ago
|
||
bugherder |
Comment 12•5 years ago
|
||
This isn't a new issue and we're out of betas for Fx69 -> wontfix.
Updated•2 years ago
|
Description
•