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

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

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove debug print 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/SVGFEDisplacementMapElement.h ('k') | Source/core/svg/SVGFEDropShadowElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFEDisplacementMapElement.cpp
diff --git a/Source/core/svg/SVGFEDisplacementMapElement.cpp b/Source/core/svg/SVGFEDisplacementMapElement.cpp
index 8ee3fc0b8689c99125499ccd521b94e3cb26c6a0..f01722d9a713b8b30d569adfd8d0371b07dd850c 100644
--- a/Source/core/svg/SVGFEDisplacementMapElement.cpp
+++ b/Source/core/svg/SVGFEDisplacementMapElement.cpp
@@ -29,14 +29,10 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::inAttr, In1, in1)
-DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::in2Attr, In2, in2)
DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, XChannelSelector, xChannelSelector, ChannelSelectorType)
DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector, ChannelSelectorType)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
- REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector)
REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
@@ -45,12 +41,16 @@ END_REGISTER_ANIMATED_PROPERTIES
inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(Document& document)
: SVGFilterPrimitiveStandardAttributes(SVGNames::feDisplacementMapTag, document)
, m_scale(SVGAnimatedNumber::create(this, SVGNames::scaleAttr, SVGNumber::create(0)))
+ , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create()))
+ , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create()))
, m_xChannelSelector(CHANNEL_A)
, m_yChannelSelector(CHANNEL_A)
{
ScriptWrappable::init(this);
addToPropertyMap(m_scale);
+ addToPropertyMap(m_in1);
+ addToPropertyMap(m_in2);
registerAnimatedPropertiesForSVGFEDisplacementMapElement();
}
@@ -93,19 +93,13 @@ void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, cons
return;
}
- if (name == SVGNames::inAttr) {
- setIn1BaseValue(value);
- return;
- }
-
- if (name == SVGNames::in2Attr) {
- setIn2BaseValue(value);
- return;
- }
-
SVGParsingError parseError = NoError;
- if (name == SVGNames::scaleAttr)
+ if (name == SVGNames::inAttr)
+ m_in1->setBaseValueAsString(value, parseError);
+ else if (name == SVGNames::in2Attr)
+ m_in2->setBaseValueAsString(value, parseError);
+ else if (name == SVGNames::scaleAttr)
m_scale->setBaseValueAsString(value, parseError);
else
ASSERT_NOT_REACHED();
@@ -151,8 +145,8 @@ void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN
PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
{
- FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(in1CurrentValue()));
- FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(in2CurrentValue()));
+ FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->currentValue()->value()));
+ FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->currentValue()->value()));
if (!input1 || !input2)
return 0;
« no previous file with comments | « Source/core/svg/SVGFEDisplacementMapElement.h ('k') | Source/core/svg/SVGFEDropShadowElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698