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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 return; | 108 return; |
109 } | 109 } |
110 | 110 |
111 ASSERT_NOT_REACHED(); | 111 ASSERT_NOT_REACHED(); |
112 } | 112 } |
113 | 113 |
114 bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) | 114 bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) |
115 { | 115 { |
116 FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect)
; | 116 FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect)
; |
117 if (attrName == SVGNames::xChannelSelectorAttr) | 117 if (attrName == SVGNames::xChannelSelectorAttr) |
118 return displacementMap->setXChannelSelector(xChannelSelector()); | 118 return displacementMap->setXChannelSelector(xChannelSelectorCurrentValue
()); |
119 if (attrName == SVGNames::yChannelSelectorAttr) | 119 if (attrName == SVGNames::yChannelSelectorAttr) |
120 return displacementMap->setYChannelSelector(yChannelSelector()); | 120 return displacementMap->setYChannelSelector(yChannelSelectorCurrentValue
()); |
121 if (attrName == SVGNames::scaleAttr) | 121 if (attrName == SVGNames::scaleAttr) |
122 return displacementMap->setScale(scale()); | 122 return displacementMap->setScale(scaleCurrentValue()); |
123 | 123 |
124 ASSERT_NOT_REACHED(); | 124 ASSERT_NOT_REACHED(); |
125 return false; | 125 return false; |
126 } | 126 } |
127 | 127 |
128 void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN
ame) | 128 void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN
ame) |
129 { | 129 { |
130 if (!isSupportedAttribute(attrName)) { | 130 if (!isSupportedAttribute(attrName)) { |
131 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 131 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
132 return; | 132 return; |
133 } | 133 } |
134 | 134 |
135 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 135 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
136 | 136 |
137 if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yCha
nnelSelectorAttr || attrName == SVGNames::scaleAttr) { | 137 if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yCha
nnelSelectorAttr || attrName == SVGNames::scaleAttr) { |
138 primitiveAttributeChanged(attrName); | 138 primitiveAttributeChanged(attrName); |
139 return; | 139 return; |
140 } | 140 } |
141 | 141 |
142 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { | 142 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { |
143 invalidate(); | 143 invalidate(); |
144 return; | 144 return; |
145 } | 145 } |
146 | 146 |
147 ASSERT_NOT_REACHED(); | 147 ASSERT_NOT_REACHED(); |
148 } | 148 } |
149 | 149 |
150 PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* fi
lterBuilder, Filter* filter) | 150 PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* fi
lterBuilder, Filter* filter) |
151 { | 151 { |
152 FilterEffect* input1 = filterBuilder->getEffectById(in1()); | 152 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue()); |
153 FilterEffect* input2 = filterBuilder->getEffectById(in2()); | 153 FilterEffect* input2 = filterBuilder->getEffectById(in2CurrentValue()); |
154 | 154 |
155 if (!input1 || !input2) | 155 if (!input1 || !input2) |
156 return 0; | 156 return 0; |
157 | 157 |
158 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSele
ctor(), yChannelSelector(), scale()); | 158 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSele
ctorCurrentValue(), yChannelSelectorCurrentValue(), scaleCurrentValue()); |
159 FilterEffectVector& inputEffects = effect->inputEffects(); | 159 FilterEffectVector& inputEffects = effect->inputEffects(); |
160 inputEffects.reserveCapacity(2); | 160 inputEffects.reserveCapacity(2); |
161 inputEffects.append(input1); | 161 inputEffects.append(input1); |
162 inputEffects.append(input2); | 162 inputEffects.append(input2); |
163 return effect.release(); | 163 return effect.release(); |
164 } | 164 } |
165 | 165 |
166 } | 166 } |
OLD | NEW |