diff options
Diffstat (limited to 'Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp')
| -rw-r--r-- | Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp index 07ebc41..4fa5e30 100644 --- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp +++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp @@ -128,6 +128,28 @@ void SVGFEConvolveMatrixElement::parseMappedAttribute(Attribute* attr) SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr); } +bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) +{ + FEConvolveMatrix* convolveMatrix = static_cast<FEConvolveMatrix*>(effect); + if (attrName == SVGNames::edgeModeAttr) + return convolveMatrix->setEdgeMode(static_cast<EdgeModeType>(edgeMode())); + if (attrName == SVGNames::divisorAttr) + return convolveMatrix->setDivisor(divisor()); + if (attrName == SVGNames::biasAttr) + return convolveMatrix->setBias(bias()); + if (attrName == SVGNames::targetXAttr) + return convolveMatrix->setTargetOffset(IntPoint(targetX(), targetY())); + if (attrName == SVGNames::targetYAttr) + return convolveMatrix->setTargetOffset(IntPoint(targetX(), targetY())); + if (attrName == SVGNames::kernelUnitLengthAttr) + return convolveMatrix->setKernelUnitLength(FloatPoint(kernelUnitLengthX(), kernelUnitLengthY())); + if (attrName == SVGNames::preserveAlphaAttr) + return convolveMatrix->setPreserveAlpha(preserveAlpha()); + + ASSERT_NOT_REACHED(); + return false; +} + void SVGFEConvolveMatrixElement::setOrder(float x, float y) { setOrderXBaseValue(x); @@ -146,16 +168,18 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa { SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); - if (attrName == SVGNames::inAttr - || attrName == SVGNames::orderAttr - || attrName == SVGNames::edgeModeAttr - || attrName == SVGNames::kernelMatrixAttr + if (attrName == SVGNames::edgeModeAttr || attrName == SVGNames::divisorAttr || attrName == SVGNames::biasAttr || attrName == SVGNames::targetXAttr || attrName == SVGNames::targetYAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::preserveAlphaAttr) + primitiveAttributeChanged(attrName); + + if (attrName == SVGNames::inAttr + || attrName == SVGNames::orderAttr + || attrName == SVGNames::kernelMatrixAttr) invalidate(); } |
