| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 : SVGFilterPrimitiveStandardAttributes(SVGNames::feOffsetTag, document) | 32 : SVGFilterPrimitiveStandardAttributes(SVGNames::feOffsetTag, document) |
| 33 , m_dx(SVGAnimatedNumber::create(this, SVGNames::dxAttr, SVGNumber::create()
)) | 33 , m_dx(SVGAnimatedNumber::create(this, SVGNames::dxAttr, SVGNumber::create()
)) |
| 34 , m_dy(SVGAnimatedNumber::create(this, SVGNames::dyAttr, SVGNumber::create()
)) | 34 , m_dy(SVGAnimatedNumber::create(this, SVGNames::dyAttr, SVGNumber::create()
)) |
| 35 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 35 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
| 36 { | 36 { |
| 37 addToPropertyMap(m_dx); | 37 addToPropertyMap(m_dx); |
| 38 addToPropertyMap(m_dy); | 38 addToPropertyMap(m_dy); |
| 39 addToPropertyMap(m_in1); | 39 addToPropertyMap(m_in1); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void SVGFEOffsetElement::trace(Visitor* visitor) |
| 43 { |
| 44 visitor->trace(m_dx); |
| 45 visitor->trace(m_dy); |
| 46 visitor->trace(m_in1); |
| 47 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
| 48 } |
| 49 |
| 42 DEFINE_NODE_FACTORY(SVGFEOffsetElement) | 50 DEFINE_NODE_FACTORY(SVGFEOffsetElement) |
| 43 | 51 |
| 44 bool SVGFEOffsetElement::isSupportedAttribute(const QualifiedName& attrName) | 52 bool SVGFEOffsetElement::isSupportedAttribute(const QualifiedName& attrName) |
| 45 { | 53 { |
| 46 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 54 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 47 if (supportedAttributes.isEmpty()) { | 55 if (supportedAttributes.isEmpty()) { |
| 48 supportedAttributes.add(SVGNames::inAttr); | 56 supportedAttributes.add(SVGNames::inAttr); |
| 49 supportedAttributes.add(SVGNames::dxAttr); | 57 supportedAttributes.add(SVGNames::dxAttr); |
| 50 supportedAttributes.add(SVGNames::dyAttr); | 58 supportedAttributes.add(SVGNames::dyAttr); |
| 51 } | 59 } |
| 52 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 60 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 53 } | 61 } |
| 54 | 62 |
| 55 void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) | 63 void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) |
| 56 { | 64 { |
| 57 parseAttributeNew(name, value); | 65 parseAttributeNew(name, value); |
| 58 } | 66 } |
| 59 | 67 |
| 60 void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) | 68 void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) |
| 61 { | 69 { |
| 62 if (!isSupportedAttribute(attrName)) { | 70 if (!isSupportedAttribute(attrName)) { |
| 63 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 71 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
| 64 return; | 72 return; |
| 65 } | 73 } |
| 66 | 74 |
| 67 SVGElement::InvalidationGuard invalidationGuard(this); | 75 SVGElement::InvalidationGuard invalidationGuard(this); |
| 68 invalidate(); | 76 invalidate(); |
| 69 } | 77 } |
| 70 | 78 |
| 71 PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuild
er, Filter* filter) | 79 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder*
filterBuilder, Filter* filter) |
| 72 { | 80 { |
| 73 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 81 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
| 74 | 82 |
| 75 if (!input1) | 83 if (!input1) |
| 76 return nullptr; | 84 return nullptr; |
| 77 | 85 |
| 78 RefPtr<FilterEffect> effect = FEOffset::create(filter, m_dx->currentValue()-
>value(), m_dy->currentValue()->value()); | 86 RefPtrWillBeRawPtr<FilterEffect> effect = FEOffset::create(filter, m_dx->cur
rentValue()->value(), m_dy->currentValue()->value()); |
| 79 effect->inputEffects().append(input1); | 87 effect->inputEffects().append(input1); |
| 80 return effect.release(); | 88 return effect.release(); |
| 81 } | 89 } |
| 82 | 90 |
| 83 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |