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 20 matching lines...) Expand all Loading... |
31 template<> const SVGEnumerationStringEntries& getStaticStringEntries<MorphologyO
peratorType>() | 31 template<> const SVGEnumerationStringEntries& getStaticStringEntries<MorphologyO
peratorType>() |
32 { | 32 { |
33 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 33 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
34 if (entries.isEmpty()) { | 34 if (entries.isEmpty()) { |
35 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_ERODE, "erode")); | 35 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_ERODE, "erode")); |
36 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_DILATE, "dilate")); | 36 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_DILATE, "dilate")); |
37 } | 37 } |
38 return entries; | 38 return entries; |
39 } | 39 } |
40 | 40 |
41 SVGFEMorphologyElement::SVGFEMorphologyElement(Document& document) | 41 inline SVGFEMorphologyElement::SVGFEMorphologyElement(Document& document) |
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 ScriptWrappable::init(this); | 47 ScriptWrappable::init(this); |
48 | 48 |
49 addToPropertyMap(m_radius); | 49 addToPropertyMap(m_radius); |
50 addToPropertyMap(m_in1); | 50 addToPropertyMap(m_in1); |
51 addToPropertyMap(m_svgOperator); | 51 addToPropertyMap(m_svgOperator); |
52 } | 52 } |
53 | 53 |
| 54 DEFINE_NODE_FACTORY(SVGFEMorphologyElement) |
| 55 |
54 void SVGFEMorphologyElement::setRadius(float x, float y) | 56 void SVGFEMorphologyElement::setRadius(float x, float y) |
55 { | 57 { |
56 radiusX()->baseValue()->setValue(x); | 58 radiusX()->baseValue()->setValue(x); |
57 radiusY()->baseValue()->setValue(y); | 59 radiusY()->baseValue()->setValue(y); |
58 invalidate(); | 60 invalidate(); |
59 } | 61 } |
60 | 62 |
61 bool SVGFEMorphologyElement::isSupportedAttribute(const QualifiedName& attrName) | 63 bool SVGFEMorphologyElement::isSupportedAttribute(const QualifiedName& attrName) |
62 { | 64 { |
63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 65 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 141 |
140 if (xRadius < 0 || yRadius < 0) | 142 if (xRadius < 0 || yRadius < 0) |
141 return nullptr; | 143 return nullptr; |
142 | 144 |
143 RefPtr<FilterEffect> effect = FEMorphology::create(filter, m_svgOperator->cu
rrentValue()->enumValue(), xRadius, yRadius); | 145 RefPtr<FilterEffect> effect = FEMorphology::create(filter, m_svgOperator->cu
rrentValue()->enumValue(), xRadius, yRadius); |
144 effect->inputEffects().append(input1); | 146 effect->inputEffects().append(input1); |
145 return effect.release(); | 147 return effect.release(); |
146 } | 148 } |
147 | 149 |
148 } // namespace WebCore | 150 } // namespace WebCore |
OLD | NEW |