Set D2D filter light source angles in the range D2D supports

NEW
Unassigned

Status

()

Core
Graphics
P3
normal
3 years ago
11 months ago

People

(Reporter: Tom Klein, Unassigned)

Tracking

({feature})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gfx-noted])

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
Created attachment 8659041 [details]
windowsAngleTest.svg

D2D1 only accepts filter light source angles in a limited range, but we're not doing any checking (and svg allows any angle), so in out of range cases we're getting the default angle.

azimuth and elevation on feDistantLight are affected, since D2D1 only accepts angles between 0 and 360:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn934239%28v=vs.85%29.aspx

I guess limitingConeAngle on feSpotLight is also affected (I haven't tested yet), and in that case D2D1 only accepts angles between 0 and 90:
https://msdn.microsoft.com/en-us/library/windows/desktop/hh706326%28v=vs.85%29.aspx

In the test case an feDistantLight source is applied with an azimuth="-45", but the filter renders with an azimuth="0" (the default value).
(Reporter)

Updated

3 years ago
Assignee: nobody → twointofive
(Reporter)

Comment 1

3 years ago
Created attachment 8702434 [details] [diff] [review]
Patch v1

The patch does a couple things:

* Puts elevation and azimuth angles for diffuse and specular distant lighting filters in the range 0 to 360 for D2D - anything outside that range gets set to 0 by D2D.  Current ff software filters, Chrome, and IE correctly support values outside 0 to 360.

* Clamps limitingConeAngle for diffuse and specular spot lighting filters to the range -90 to 90, which is what D2D and other browsers do (so as far as I know ff software filters were the only case where that angle wasn't being clamped).  Also further folds that angle into 0 to 90 since that's what the D2D docs say is required (even though functionally they do the right thing with an angle between -90 and 0).
Attachment #8702434 - Flags: review?(mstange)
Keywords: feature
(Reporter)

Updated

a year ago
Assignee: twointofive → nobody
(Reporter)

Updated

a year ago
Attachment #8702434 - Flags: review?(mstange)
Whiteboard: [gfx-noted]
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.