Open Bug 1203387 Opened 9 years ago Updated 2 years ago

Set D2D filter light source angles in the range D2D supports

Categories

(Core :: Graphics, defect, P3)

Unspecified
Windows
defect

Tracking

()

People

(Reporter: twointofive, Unassigned)

Details

(Whiteboard: [gfx-noted])

Attachments

(2 files)

Attached image 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).
Assignee: nobody → twointofive
Attached patch Patch v1Splinter Review
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
Assignee: twointofive → nobody
Attachment #8702434 - Flags: review?(mstange)
Whiteboard: [gfx-noted]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: