Fix lighting image filters
1. Removes clamping of spotlight's specular exponent, which is not the
specified behavior of feSpotLight in SVG.
(note: we never clamped a specular lighting effect's
specular exponent/shininess parameter, although SVG 1.1 does clamp
that; that is the client's responsibility).
2. Fixes a bug in the GPU implementation of scale factor for spot lights.
3. Saturate computed lighting color after multiplying with color scale,
instead of just saturating the color scale (allows high intensity
lights to saturate to white which is more reasonable approximation of
an HDR effect stored in an LDR color).
Note: fixes 1 and 2 were originally addressed in https://bugs.chromium.org/p/chromium/issues/detail?id=472849
but the change was reverted for layout failure reasons and it was never
relanded after rebasing.
Note2: most of the layout test rebaselines necessary for chrome are
minor and related to fix 2. The exception is svg/dynamic-updates/SVGFESpecularLightingElement-dom-kernelUnitLength-attr.html
which is the result of fix 3. It took a little digging, but I believe
that fix 3 actually makes that generated SVG more correct (it's original
expected image was "wrong").
In that test, it has a specular constant of 4 (which is a multiplier)
and a shininess of 1 (which makes it practically a "diffuse" specular).
So basically we are multiplying the greenYellow color by 4 for most of
the image that has a normal pointing out of the screen. Firefox renders
a similarly yellow oversaturated appearance instead of clamping to the
base greenYellow.
Reading the feSpecularLighting spec, there is no saturation that is
specified where it had been performed before this change. Instead, all
that is mentioned is that the results of a given filter have to be pinned
to the color channel range (e.g. the last step).
Bug: skia:11007, skia:11057, skia:11153
Change-Id: I82e4a6f1742fecea59816fda75eb931c2a51d3e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355496
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index aa71d6d..7627671 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -10,6 +10,15 @@
* Deprecate (and ignore) SkAndroidCodec::ExifOrientation
https://review.skia.org/344763
+ * Fix several minor issues in lighting image filters:
+ - The spotlight falloff exponent is no longer clamped to [1, 128]. SVG 1.1 requires the specular
+ lighting effect's exponent (shininess) to be clamped; not the spotlight's falloff. Any such
+ parameter clamping is the client's responisibility, which makes Skia's lighting effect easily
+ adaptable to SVG 1.1 (clamp exponent) or SVG 2 (no clamp).
+ - Fix spotlight incorrectly scaling light within the cone angle.
+ - Move saturation of RGBA to after multiplying lighting intensity with the lighting color, which
+ improves rendering when diffuse and specular constants are greater than 1.
+ https://review.skia.org/355496
Milestone 89
------------