OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> | 2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> |
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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement) | 38 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement) |
39 REGISTER_LOCAL_ANIMATED_PROPERTY(in1) | 39 REGISTER_LOCAL_ANIMATED_PROPERTY(in1) |
40 REGISTER_LOCAL_ANIMATED_PROPERTY(in2) | 40 REGISTER_LOCAL_ANIMATED_PROPERTY(in2) |
41 REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector) | 41 REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector) |
42 REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector) | 42 REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector) |
43 REGISTER_LOCAL_ANIMATED_PROPERTY(scale) | 43 REGISTER_LOCAL_ANIMATED_PROPERTY(scale) |
44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) | 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) |
45 END_REGISTER_ANIMATED_PROPERTIES | 45 END_REGISTER_ANIMATED_PROPERTIES |
46 | 46 |
47 inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedN
ame& tagName, Document& document) | 47 inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(Document& docume
nt) |
48 : SVGFilterPrimitiveStandardAttributes(tagName, document) | 48 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDisplacementMapTag, docum
ent) |
49 , m_xChannelSelector(CHANNEL_A) | 49 , m_xChannelSelector(CHANNEL_A) |
50 , m_yChannelSelector(CHANNEL_A) | 50 , m_yChannelSelector(CHANNEL_A) |
51 { | 51 { |
52 ASSERT(hasTagName(SVGNames::feDisplacementMapTag)); | |
53 ScriptWrappable::init(this); | 52 ScriptWrappable::init(this); |
54 registerAnimatedPropertiesForSVGFEDisplacementMapElement(); | 53 registerAnimatedPropertiesForSVGFEDisplacementMapElement(); |
55 } | 54 } |
56 | 55 |
57 PassRefPtr<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(cons
t QualifiedName& tagName, Document& document) | 56 PassRefPtr<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(Docu
ment& document) |
58 { | 57 { |
59 return adoptRef(new SVGFEDisplacementMapElement(tagName, document)); | 58 return adoptRef(new SVGFEDisplacementMapElement(document)); |
60 } | 59 } |
61 | 60 |
62 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr
Name) | 61 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr
Name) |
63 { | 62 { |
64 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
65 if (supportedAttributes.isEmpty()) { | 64 if (supportedAttributes.isEmpty()) { |
66 supportedAttributes.add(SVGNames::inAttr); | 65 supportedAttributes.add(SVGNames::inAttr); |
67 supportedAttributes.add(SVGNames::in2Attr); | 66 supportedAttributes.add(SVGNames::in2Attr); |
68 supportedAttributes.add(SVGNames::xChannelSelectorAttr); | 67 supportedAttributes.add(SVGNames::xChannelSelectorAttr); |
69 supportedAttributes.add(SVGNames::yChannelSelectorAttr); | 68 supportedAttributes.add(SVGNames::yChannelSelectorAttr); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 156 |
158 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSele
ctorCurrentValue(), yChannelSelectorCurrentValue(), scaleCurrentValue()); | 157 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSele
ctorCurrentValue(), yChannelSelectorCurrentValue(), scaleCurrentValue()); |
159 FilterEffectVector& inputEffects = effect->inputEffects(); | 158 FilterEffectVector& inputEffects = effect->inputEffects(); |
160 inputEffects.reserveCapacity(2); | 159 inputEffects.reserveCapacity(2); |
161 inputEffects.append(input1); | 160 inputEffects.append(input1); |
162 inputEffects.append(input2); | 161 inputEffects.append(input2); |
163 return effect.release(); | 162 return effect.release(); |
164 } | 163 } |
165 | 164 |
166 } | 165 } |
OLD | NEW |