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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 , m_xChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi
s, SVGNames::xChannelSelectorAttr, CHANNEL_A)) | 47 , m_xChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi
s, SVGNames::xChannelSelectorAttr, CHANNEL_A)) |
48 , m_yChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi
s, SVGNames::yChannelSelectorAttr, CHANNEL_A)) | 48 , m_yChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi
s, SVGNames::yChannelSelectorAttr, CHANNEL_A)) |
49 { | 49 { |
50 addToPropertyMap(m_scale); | 50 addToPropertyMap(m_scale); |
51 addToPropertyMap(m_in1); | 51 addToPropertyMap(m_in1); |
52 addToPropertyMap(m_in2); | 52 addToPropertyMap(m_in2); |
53 addToPropertyMap(m_xChannelSelector); | 53 addToPropertyMap(m_xChannelSelector); |
54 addToPropertyMap(m_yChannelSelector); | 54 addToPropertyMap(m_yChannelSelector); |
55 } | 55 } |
56 | 56 |
| 57 void SVGFEDisplacementMapElement::trace(Visitor* visitor) |
| 58 { |
| 59 visitor->trace(m_scale); |
| 60 visitor->trace(m_in1); |
| 61 visitor->trace(m_in2); |
| 62 visitor->trace(m_xChannelSelector); |
| 63 visitor->trace(m_yChannelSelector); |
| 64 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
| 65 } |
| 66 |
57 DEFINE_NODE_FACTORY(SVGFEDisplacementMapElement) | 67 DEFINE_NODE_FACTORY(SVGFEDisplacementMapElement) |
58 | 68 |
59 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr
Name) | 69 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr
Name) |
60 { | 70 { |
61 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 71 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
62 if (supportedAttributes.isEmpty()) { | 72 if (supportedAttributes.isEmpty()) { |
63 supportedAttributes.add(SVGNames::inAttr); | 73 supportedAttributes.add(SVGNames::inAttr); |
64 supportedAttributes.add(SVGNames::in2Attr); | 74 supportedAttributes.add(SVGNames::in2Attr); |
65 supportedAttributes.add(SVGNames::xChannelSelectorAttr); | 75 supportedAttributes.add(SVGNames::xChannelSelectorAttr); |
66 supportedAttributes.add(SVGNames::yChannelSelectorAttr); | 76 supportedAttributes.add(SVGNames::yChannelSelectorAttr); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 113 } |
104 | 114 |
105 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { | 115 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { |
106 invalidate(); | 116 invalidate(); |
107 return; | 117 return; |
108 } | 118 } |
109 | 119 |
110 ASSERT_NOT_REACHED(); | 120 ASSERT_NOT_REACHED(); |
111 } | 121 } |
112 | 122 |
113 PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* fi
lterBuilder, Filter* filter) | 123 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilte
rBuilder* filterBuilder, Filter* filter) |
114 { | 124 { |
115 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 125 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
116 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr
entValue()->value())); | 126 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr
entValue()->value())); |
117 | 127 |
118 if (!input1 || !input2) | 128 if (!input1 || !input2) |
119 return nullptr; | 129 return nullptr; |
120 | 130 |
121 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSe
lector->currentValue()->enumValue(), m_yChannelSelector->currentValue()->enumVal
ue(), m_scale->currentValue()->value()); | 131 RefPtrWillBeRawPtr<FilterEffect> effect = FEDisplacementMap::create(filter,
m_xChannelSelector->currentValue()->enumValue(), m_yChannelSelector->currentValu
e()->enumValue(), m_scale->currentValue()->value()); |
122 FilterEffectVector& inputEffects = effect->inputEffects(); | 132 FilterEffectVector& inputEffects = effect->inputEffects(); |
123 inputEffects.reserveCapacity(2); | 133 inputEffects.reserveCapacity(2); |
124 inputEffects.append(input1); | 134 inputEffects.append(input1); |
125 inputEffects.append(input2); | 135 inputEffects.append(input2); |
126 return effect.release(); | 136 return effect.release(); |
127 } | 137 } |
128 | 138 |
129 } // namespace blink | 139 } // namespace blink |
OLD | NEW |