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

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

Issue 131253002: [SVG] SVGAnimatedBoolean migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 11 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
« no previous file with comments | « Source/core/svg/SVGFEConvolveMatrixElement.h ('k') | Source/core/svg/SVGLength.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFEConvolveMatrixElement.cpp
diff --git a/Source/core/svg/SVGFEConvolveMatrixElement.cpp b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
index 7fff7f6395fcf647a3676f681a1b4ce0a039e97b..4e712ac4ae82a5cbe9c36a3e539bd035e928f4a7 100644
--- a/Source/core/svg/SVGFEConvolveMatrixElement.cpp
+++ b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
@@ -44,7 +44,6 @@ DEFINE_ANIMATED_INTEGER(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, Targe
DEFINE_ANIMATED_ENUMERATION(SVGFEConvolveMatrixElement, SVGNames::edgeModeAttr, EdgeMode, edgeMode, EdgeModeType)
DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
-DEFINE_ANIMATED_BOOLEAN(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, PreserveAlpha, preserveAlpha)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
@@ -58,15 +57,18 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(edgeMode)
REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
- REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAlpha)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(Document& document)
: SVGFilterPrimitiveStandardAttributes(SVGNames::feConvolveMatrixTag, document)
+ , m_preserveAlpha(SVGAnimatedBoolean::create(this, SVGNames::preserveAlphaAttr, SVGBoolean::create()))
, m_edgeMode(EDGEMODE_DUPLICATE)
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_preserveAlpha);
+
registerAnimatedPropertiesForSVGFEConvolveMatrixElement();
}
@@ -201,14 +203,9 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const
}
if (name == SVGNames::preserveAlphaAttr) {
- if (value == "true")
- setPreserveAlphaBaseValue(true);
- else if (value == "false")
- setPreserveAlphaBaseValue(false);
- else
- document().accessSVGExtensions()->reportWarning(
- "feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value
- + "\". Filtered element will not be displayed.");
+ SVGParsingError parseError = NoError;
+ m_preserveAlpha->setBaseValueAsString(value, parseError);
+ reportAttributeParsingError(parseError, name, value);
return;
}
@@ -231,7 +228,7 @@ bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect,
if (attrName == SVGNames::kernelUnitLengthAttr)
return convolveMatrix->setKernelUnitLength(FloatPoint(kernelUnitLengthXCurrentValue(), kernelUnitLengthYCurrentValue()));
if (attrName == SVGNames::preserveAlphaAttr)
- return convolveMatrix->setPreserveAlpha(preserveAlphaCurrentValue());
+ return convolveMatrix->setPreserveAlpha(m_preserveAlpha->currentValue()->value());
ASSERT_NOT_REACHED();
return false;
@@ -339,7 +336,7 @@ PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* fil
RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter,
IntSize(orderXValue, orderYValue), divisorValue,
biasCurrentValue(), IntPoint(targetXValue, targetYValue), edgeModeCurrentValue(),
- FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue), preserveAlphaCurrentValue(), kernelMatrix.toFloatVector());
+ FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue), m_preserveAlpha->currentValue()->value(), kernelMatrix.toFloatVector());
effect->inputEffects().append(input1);
return effect.release();
}
« no previous file with comments | « Source/core/svg/SVGFEConvolveMatrixElement.h ('k') | Source/core/svg/SVGLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698