OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 ASSERT_NOT_REACHED(); | 125 ASSERT_NOT_REACHED(); |
126 } | 126 } |
127 | 127 |
128 bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const
QualifiedName& attrName) | 128 bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const
QualifiedName& attrName) |
129 { | 129 { |
130 FEComposite* composite = static_cast<FEComposite*>(effect); | 130 FEComposite* composite = static_cast<FEComposite*>(effect); |
131 if (attrName == SVGNames::operatorAttr) | 131 if (attrName == SVGNames::operatorAttr) |
132 return composite->setOperation(_operator()); | 132 return composite->setOperation(_operatorCurrentValue()); |
133 if (attrName == SVGNames::k1Attr) | 133 if (attrName == SVGNames::k1Attr) |
134 return composite->setK1(k1()); | 134 return composite->setK1(k1CurrentValue()); |
135 if (attrName == SVGNames::k2Attr) | 135 if (attrName == SVGNames::k2Attr) |
136 return composite->setK2(k2()); | 136 return composite->setK2(k2CurrentValue()); |
137 if (attrName == SVGNames::k3Attr) | 137 if (attrName == SVGNames::k3Attr) |
138 return composite->setK3(k3()); | 138 return composite->setK3(k3CurrentValue()); |
139 if (attrName == SVGNames::k4Attr) | 139 if (attrName == SVGNames::k4Attr) |
140 return composite->setK4(k4()); | 140 return composite->setK4(k4CurrentValue()); |
141 | 141 |
142 ASSERT_NOT_REACHED(); | 142 ASSERT_NOT_REACHED(); |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 | 146 |
147 void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) | 147 void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) |
148 { | 148 { |
149 if (!isSupportedAttribute(attrName)) { | 149 if (!isSupportedAttribute(attrName)) { |
150 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 150 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
(...skipping 14 matching lines...) Expand all Loading... |
165 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { | 165 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { |
166 invalidate(); | 166 invalidate(); |
167 return; | 167 return; |
168 } | 168 } |
169 | 169 |
170 ASSERT_NOT_REACHED(); | 170 ASSERT_NOT_REACHED(); |
171 } | 171 } |
172 | 172 |
173 PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBu
ilder, Filter* filter) | 173 PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBu
ilder, Filter* filter) |
174 { | 174 { |
175 FilterEffect* input1 = filterBuilder->getEffectById(in1()); | 175 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue()); |
176 FilterEffect* input2 = filterBuilder->getEffectById(in2()); | 176 FilterEffect* input2 = filterBuilder->getEffectById(in2CurrentValue()); |
177 | 177 |
178 if (!input1 || !input2) | 178 if (!input1 || !input2) |
179 return 0; | 179 return 0; |
180 | 180 |
181 RefPtr<FilterEffect> effect = FEComposite::create(filter, _operator(), k1(),
k2(), k3(), k4()); | 181 RefPtr<FilterEffect> effect = FEComposite::create(filter, _operatorCurrentVa
lue(), k1CurrentValue(), k2CurrentValue(), k3CurrentValue(), k4CurrentValue()); |
182 FilterEffectVector& inputEffects = effect->inputEffects(); | 182 FilterEffectVector& inputEffects = effect->inputEffects(); |
183 inputEffects.reserveCapacity(2); | 183 inputEffects.reserveCapacity(2); |
184 inputEffects.append(input1); | 184 inputEffects.append(input1); |
185 inputEffects.append(input2); | 185 inputEffects.append(input2); |
186 return effect.release(); | 186 return effect.release(); |
187 } | 187 } |
188 | 188 |
189 } | 189 } |
OLD | NEW |