Bug 527325 - feConvoleMatrix does not process bias correctly. r=roc

This commit is contained in:
Robert Longson 2009-11-10 18:49:37 +00:00
parent 93a572947c
commit b93042d2d4
4 changed files with 25 additions and 1 deletions

View File

@ -4084,7 +4084,7 @@ ConvolvePixel(const PRUint8 *aSourceData,
}
for (PRInt32 i = 0; i < channels; i++) {
aTargetData[aY * aStride + 4 * aX + offsets[i]] =
BoundInterval(static_cast<PRInt32>(sum[i] / aDivisor + aBias * 255), 256);
BoundInterval(static_cast<PRInt32>(sum[i] / aDivisor + aBias), 256);
}
if (aPreserveAlpha) {
aTargetData[aY * aStride + 4 * aX + GFX_ARGB32_OFFSET_A] =

View File

@ -0,0 +1,9 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Reference for feConvolveMatrix with bias</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=527325 -->
<rect x="0" y="0" width="100" height="100" fill="rgb(187,255,187)"/>
</svg>

After

Width:  |  Height:  |  Size: 363 B

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Testcase for feConvolveMatrix with bias</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=527325 -->
<defs>
<filter id="filter" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix kernelMatrix="1 1 1 1 1 1 1 1 1" bias="0.5"/>
</filter>
</defs>
<rect x="0" y="0" width="100" height="100" fill="rgb(0,255,0)" filter="url(#filter)"/>
</svg>

After

Width:  |  Height:  |  Size: 624 B

View File

@ -68,6 +68,7 @@ fails == filter-marked-line-01.svg pass.svg # bug 477704
== filter-patterned-rect-02.svg pass.svg
== feComposite-arguments-01.svg pass.svg
== feConvolveMatrix-bias-01.svg feConvolveMatrix-bias-01-ref.svg
== feConvolveMatrix-order-01.svg feConvolveMatrix-order-01-ref.svg
== feMorphology-radius-negative-01.svg pass.svg