Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Unified Diff: Source/core/svg/SVGFEConvolveMatrixElement.cpp

Issue 1354923003: Remove kernelUnitLength plumbing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TEs Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGFEConvolveMatrixElement.cpp
diff --git a/Source/core/svg/SVGFEConvolveMatrixElement.cpp b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
index 82070e88352c0b74f9008bcf155c3ae62da7a21f..dc04bafaf03f488cf0ca0e89bc14c8513ea9b64c 100644
--- a/Source/core/svg/SVGFEConvolveMatrixElement.cpp
+++ b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
@@ -126,8 +126,6 @@ bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect,
return convolveMatrix->setTargetOffset(IntPoint(m_targetX->currentValue()->value(), m_targetY->currentValue()->value()));
if (attrName == SVGNames::targetYAttr)
return convolveMatrix->setTargetOffset(IntPoint(m_targetX->currentValue()->value(), m_targetY->currentValue()->value()));
- if (attrName == SVGNames::kernelUnitLengthAttr)
- return convolveMatrix->setKernelUnitLength(FloatPoint(kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->currentValue()->value()));
if (attrName == SVGNames::preserveAlphaAttr)
return convolveMatrix->setPreserveAlpha(m_preserveAlpha->currentValue()->value());
@@ -142,7 +140,6 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa
|| attrName == SVGNames::biasAttr
|| attrName == SVGNames::targetXAttr
|| attrName == SVGNames::targetYAttr
- || attrName == SVGNames::kernelUnitLengthAttr
|| attrName == SVGNames::preserveAlphaAttr) {
SVGElement::InvalidationGuard invalidationGuard(this);
primitiveAttributeChanged(attrName);
@@ -195,17 +192,6 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilter
if (!hasAttribute(SVGNames::targetYAttr))
targetYValue = static_cast<int>(floorf(orderYValue / 2));
- // Spec says default kernelUnitLength is 1.0, and a specified length cannot be 0.
- // FIXME: Why is this cast from float -> int -> float?
- int kernelUnitLengthXValue = kernelUnitLengthX()->currentValue()->value();
- int kernelUnitLengthYValue = kernelUnitLengthY()->currentValue()->value();
- if (!hasAttribute(SVGNames::kernelUnitLengthAttr)) {
- kernelUnitLengthXValue = 1;
- kernelUnitLengthYValue = 1;
- }
- if (kernelUnitLengthXValue <= 0 || kernelUnitLengthYValue <= 0)
- return nullptr;
-
float divisorValue = m_divisor->currentValue()->value();
if (hasAttribute(SVGNames::divisorAttr) && !divisorValue)
return nullptr;
@@ -219,7 +205,7 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilter
RefPtrWillBeRawPtr<FilterEffect> effect = FEConvolveMatrix::create(filter,
IntSize(orderXValue, orderYValue), divisorValue,
m_bias->currentValue()->value(), IntPoint(targetXValue, targetYValue), m_edgeMode->currentValue()->enumValue(),
- FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue), m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloatVector());
+ m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloatVector());
effect->inputEffects().append(input1);
return effect.release();
}

Powered by Google App Engine
This is Rietveld 408576698