Closed Bug 1596513 Opened 6 years ago Closed 6 years ago

[SVG] drop-shadow blur becomes solid when WebRender is on

Categories

(Core :: Graphics: WebRender, defect, P3)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: bugzilla, Assigned: cbrewster)

Details

Attachments

(7 files)

Attached image tab-drag-indicator.svg

I was working with the attached SVG and noticed that its blur becomes solid when WebRender is enabled. The issue only exists when it uses drop-shadow; it renders fine when using other forms of SVG shadows instead. The issue was resolved by disabling WebRender.

I'll attach screenshots of how it rendered when I pasted the markup into SVGOMG.

Attached image WebRender_disabled.png

This is the way it should render, and how it does render when WebRender is disabled.

Attached image WebRender_enabled.png

Here it is with WR enabled.

Priority: -- → P3

I still get the drop shadow blur with webrender enabled (tested on macOS). So maybe it's something specific to your setup.

Can you paste your about:support?

Flags: needinfo?(htwyford)
Attached file about:support
```
Flags: needinfo?(htwyford)

WebRender is not taking into account scale factors when determining the standard deviation for the blur when rendering the shadow for drop-shadows.

Blur: https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/picture.rs#3980

Drop Shadow: https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/picture.rs#4122

See also the examples on https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDropShadow, two of which appear to be affected by this.

WebRender expects drop shadow dx/dy to be in user space, which is a floating point value.
Before this, a dx/dy such as (0.2, 0.2) was truncated to (0, 0) resulting in no offset of the shadow.

Depends on D63441

Assignee: nobody → connorbrewster

Connor, this failed to land with the following error: applying /tmp/tmpbJJCpy 2 out of 2 hunks ignored -- saving rejects to file layout/svg/nsFilterInstance.cpp.rej abort: patch command failed: exited with status 256

Flags: needinfo?(connorbrewster)

Not sure what happened there. I have rebased the commits onto the latest central.

Flags: needinfo?(connorbrewster)

Same thing: Details: applying /tmp/tmptoYfGg 2 out of 2 hunks ignored -- saving rejects to file layout/svg/nsFilterInstance.cpp.rej abort: patch command failed: exited with status 256

Flags: needinfo?(connorbrewster)

Looks like my commit was conflicting with a reformat commit that was in autoland (https://hg.mozilla.org/mozilla-central/rev/06762c633bf6f4609c31add3b3a6df7c2ee5373e). I've rebased onto central which now has the reformat commit. This should be able to be applied cleanly now.

Flags: needinfo?(connorbrewster)
Pushed by apavel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/889cee140af8 Part 1: Take scale factors into account when rendering drop shadows in WebRender r=gfx-reviewers,kvark https://hg.mozilla.org/integration/autoland/rev/49e61b566da1 Part 2: Allow for floating point dx/dy on feDropShadow attributes r=nical

This was causing one of the large drop-shadow wrench reftests to timeout.
This is only a partial fix, as we should be checking the scale factors earlier on when sanitizing the
filter input. This will ensure we match what the non-WR backend is doing and will prevent overinflation.

Flags: needinfo?(connorbrewster)

Tried to land latest changes but received:
"We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. applying /tmp/tmp_sGwPN gfx/wr/webrender/src/picture.rs Hunk #1 FAILED at 96. 1 out of 2 hunks FAILED -- saving rejects to file gfx/wr/webrender/src/picture.rs.rej abort: patch command failed: exited with status 256 "

Flags: needinfo?(connorbrewster)

Rebased on top of central.

Flags: needinfo?(connorbrewster)
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9d8b62a3993 Part 1: Take scale factors into account when rendering drop shadows in WebRender r=gfx-reviewers,kvark https://hg.mozilla.org/integration/autoland/rev/ce1593bf9d51 Part 2: Allow for floating point dx/dy on feDropShadow attributes r=nical https://hg.mozilla.org/integration/autoland/rev/b7ab4c947688 Part 3: Ensure drop shadow blur radius does not exceed MAX_BLUR after scale factors are applied r=gfx-reviewers,nical
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: