Bug 494201 - feComposite has arguments inverted. r=longsonr

This commit is contained in:
Takeshi Kurosawa 2009-09-07 08:33:22 +01:00
parent b432764e55
commit ecd56e6571
3 changed files with 15 additions and 2 deletions

View File

@ -1499,8 +1499,8 @@ nsSVGFECompositeElement::Filter(nsSVGFilterInstance *instance,
for (PRInt32 y = rect.y; y < rect.YMost(); y++) {
PRUint32 targIndex = y * stride + 4 * x;
for (PRInt32 i = 0; i < 4; i++) {
PRUint8 i2 = targetData[targIndex + i];
PRUint8 i1 = sourceData[targIndex + i];
PRUint8 i1 = targetData[targIndex + i];
PRUint8 i2 = sourceData[targIndex + i];
float result = k1Scaled*i1*i2 + k2*i1 + k3*i2 + k4Scaled;
targetData[targIndex + i] =
static_cast<PRUint8>(PR_MIN(PR_MAX(0, result), 255));

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="filter">
<feFlood flood-color="lime" result="flood1"/>
<feFlood flood-color="red" result="flood2"/>
<feComposite in="flood1" in2="flood2"
operator="arithmetic" k1="0" k2="1" k3="0" k4="0" />
</filter>
</defs>
<rect width="100%" height="100%" fill="yellow" filter="url(#filter)"/>
</svg>

After

Width:  |  Height:  |  Size: 399 B

View File

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