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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return; | 90 return; |
91 } | 91 } |
92 | 92 |
93 ASSERT_NOT_REACHED(); | 93 ASSERT_NOT_REACHED(); |
94 } | 94 } |
95 | 95 |
96 bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
lifiedName& attrName) | 96 bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
lifiedName& attrName) |
97 { | 97 { |
98 FEBlend* blend = static_cast<FEBlend*>(effect); | 98 FEBlend* blend = static_cast<FEBlend*>(effect); |
99 if (attrName == SVGNames::modeAttr) | 99 if (attrName == SVGNames::modeAttr) |
100 return blend->setBlendMode(mode()); | 100 return blend->setBlendMode(modeCurrentValue()); |
101 | 101 |
102 ASSERT_NOT_REACHED(); | 102 ASSERT_NOT_REACHED(); |
103 return false; | 103 return false; |
104 } | 104 } |
105 | 105 |
106 void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) | 106 void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) |
107 { | 107 { |
108 if (!isSupportedAttribute(attrName)) { | 108 if (!isSupportedAttribute(attrName)) { |
109 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 109 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
110 return; | 110 return; |
111 } | 111 } |
112 | 112 |
113 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 113 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
114 | 114 |
115 if (attrName == SVGNames::modeAttr) { | 115 if (attrName == SVGNames::modeAttr) { |
116 primitiveAttributeChanged(attrName); | 116 primitiveAttributeChanged(attrName); |
117 return; | 117 return; |
118 } | 118 } |
119 | 119 |
120 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { | 120 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { |
121 invalidate(); | 121 invalidate(); |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 ASSERT_NOT_REACHED(); | 125 ASSERT_NOT_REACHED(); |
126 } | 126 } |
127 | 127 |
128 PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilde
r, Filter* filter) | 128 PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilde
r, Filter* filter) |
129 { | 129 { |
130 FilterEffect* input1 = filterBuilder->getEffectById(in1()); | 130 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue()); |
131 FilterEffect* input2 = filterBuilder->getEffectById(in2()); | 131 FilterEffect* input2 = filterBuilder->getEffectById(in2CurrentValue()); |
132 | 132 |
133 if (!input1 || !input2) | 133 if (!input1 || !input2) |
134 return 0; | 134 return 0; |
135 | 135 |
136 RefPtr<FilterEffect> effect = FEBlend::create(filter, mode()); | 136 RefPtr<FilterEffect> effect = FEBlend::create(filter, modeCurrentValue()); |
137 FilterEffectVector& inputEffects = effect->inputEffects(); | 137 FilterEffectVector& inputEffects = effect->inputEffects(); |
138 inputEffects.reserveCapacity(2); | 138 inputEffects.reserveCapacity(2); |
139 inputEffects.append(input1); | 139 inputEffects.append(input1); |
140 inputEffects.append(input2); | 140 inputEffects.append(input2); |
141 return effect.release(); | 141 return effect.release(); |
142 } | 142 } |
143 | 143 |
144 } | 144 } |
OLD | NEW |