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

Unified Diff: Source/core/svg/SVGFEBlendElement.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/SVGFEBlendElement.h ('k') | Source/core/svg/SVGFEColorMatrixElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFEBlendElement.cpp
diff --git a/Source/core/svg/SVGFEBlendElement.cpp b/Source/core/svg/SVGFEBlendElement.cpp
index 5dc45e3f76a23d51563323249cbae5570c9e0f7b..53556fdd3943ac1db24af5d2cd33598ce1ad813a 100644
--- a/Source/core/svg/SVGFEBlendElement.cpp
+++ b/Source/core/svg/SVGFEBlendElement.cpp
@@ -30,22 +30,22 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::inAttr, In1, in1)
-DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::in2Attr, In2, in2)
DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendModeType)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEBlendElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
- REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
REGISTER_LOCAL_ANIMATED_PROPERTY(mode)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGFEBlendElement::SVGFEBlendElement(Document& document)
: SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document)
+ , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create()))
+ , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create()))
, m_mode(FEBLEND_MODE_NORMAL)
{
ScriptWrappable::init(this);
+ addToPropertyMap(m_in1);
+ addToPropertyMap(m_in2);
registerAnimatedPropertiesForSVGFEBlendElement();
}
@@ -79,17 +79,16 @@ void SVGFEBlendElement::parseAttribute(const QualifiedName& name, const AtomicSt
return;
}
- if (name == SVGNames::inAttr) {
- setIn1BaseValue(value);
- return;
- }
+ SVGParsingError parseError = NoError;
- if (name == SVGNames::in2Attr) {
- setIn2BaseValue(value);
- return;
- }
+ if (name == SVGNames::inAttr)
+ m_in1->setBaseValueAsString(value, parseError);
+ else if (name == SVGNames::in2Attr)
+ m_in2->setBaseValueAsString(value, parseError);
+ else
+ ASSERT_NOT_REACHED();
- ASSERT_NOT_REACHED();
+ reportAttributeParsingError(parseError, name, value);
}
bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName)
@@ -126,8 +125,8 @@ void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName)
PassRefPtr<FilterEffect> SVGFEBlendElement::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/SVGFEBlendElement.h ('k') | Source/core/svg/SVGFEColorMatrixElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698