| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 : SVGFilterPrimitiveStandardAttributes(SVGNames::feMorphologyTag, document) | 42 : SVGFilterPrimitiveStandardAttributes(SVGNames::feMorphologyTag, document) |
| 43 , m_radius(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::radiusAtt
r)) | 43 , m_radius(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::radiusAtt
r)) |
| 44 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 44 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
| 45 , m_svgOperator(SVGAnimatedEnumeration<MorphologyOperatorType>::create(this,
SVGNames::operatorAttr, FEMORPHOLOGY_OPERATOR_ERODE)) | 45 , m_svgOperator(SVGAnimatedEnumeration<MorphologyOperatorType>::create(this,
SVGNames::operatorAttr, FEMORPHOLOGY_OPERATOR_ERODE)) |
| 46 { | 46 { |
| 47 addToPropertyMap(m_radius); | 47 addToPropertyMap(m_radius); |
| 48 addToPropertyMap(m_in1); | 48 addToPropertyMap(m_in1); |
| 49 addToPropertyMap(m_svgOperator); | 49 addToPropertyMap(m_svgOperator); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void SVGFEMorphologyElement::trace(Visitor* visitor) |
| 53 { |
| 54 visitor->trace(m_radius); |
| 55 visitor->trace(m_in1); |
| 56 visitor->trace(m_svgOperator); |
| 57 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
| 58 } |
| 59 |
| 52 DEFINE_NODE_FACTORY(SVGFEMorphologyElement) | 60 DEFINE_NODE_FACTORY(SVGFEMorphologyElement) |
| 53 | 61 |
| 54 bool SVGFEMorphologyElement::isSupportedAttribute(const QualifiedName& attrName) | 62 bool SVGFEMorphologyElement::isSupportedAttribute(const QualifiedName& attrName) |
| 55 { | 63 { |
| 56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 64 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 57 if (supportedAttributes.isEmpty()) { | 65 if (supportedAttributes.isEmpty()) { |
| 58 supportedAttributes.add(SVGNames::inAttr); | 66 supportedAttributes.add(SVGNames::inAttr); |
| 59 supportedAttributes.add(SVGNames::operatorAttr); | 67 supportedAttributes.add(SVGNames::operatorAttr); |
| 60 supportedAttributes.add(SVGNames::radiusAttr); | 68 supportedAttributes.add(SVGNames::radiusAttr); |
| 61 } | 69 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 106 } |
| 99 | 107 |
| 100 if (attrName == SVGNames::inAttr) { | 108 if (attrName == SVGNames::inAttr) { |
| 101 invalidate(); | 109 invalidate(); |
| 102 return; | 110 return; |
| 103 } | 111 } |
| 104 | 112 |
| 105 ASSERT_NOT_REACHED(); | 113 ASSERT_NOT_REACHED(); |
| 106 } | 114 } |
| 107 | 115 |
| 108 PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterB
uilder, Filter* filter) | 116 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuil
der* filterBuilder, Filter* filter) |
| 109 { | 117 { |
| 110 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 118 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
| 111 float xRadius = radiusX()->currentValue()->value(); | 119 float xRadius = radiusX()->currentValue()->value(); |
| 112 float yRadius = radiusY()->currentValue()->value(); | 120 float yRadius = radiusY()->currentValue()->value(); |
| 113 | 121 |
| 114 if (!input1) | 122 if (!input1) |
| 115 return nullptr; | 123 return nullptr; |
| 116 | 124 |
| 117 if (xRadius < 0 || yRadius < 0) | 125 if (xRadius < 0 || yRadius < 0) |
| 118 return nullptr; | 126 return nullptr; |
| 119 | 127 |
| 120 RefPtr<FilterEffect> effect = FEMorphology::create(filter, m_svgOperator->cu
rrentValue()->enumValue(), xRadius, yRadius); | 128 RefPtrWillBeRawPtr<FilterEffect> effect = FEMorphology::create(filter, m_svg
Operator->currentValue()->enumValue(), xRadius, yRadius); |
| 121 effect->inputEffects().append(input1); | 129 effect->inputEffects().append(input1); |
| 122 return effect.release(); | 130 return effect.release(); |
| 123 } | 131 } |
| 124 | 132 |
| 125 } // namespace blink | 133 } // namespace blink |
| OLD | NEW |