| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 | 117 |
| 118 ASSERT_NOT_REACHED(); | 118 ASSERT_NOT_REACHED(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, cons
t QualifiedName& attrName) | 121 bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, cons
t QualifiedName& attrName) |
| 122 { | 122 { |
| 123 FEMorphology* morphology = static_cast<FEMorphology*>(effect); | 123 FEMorphology* morphology = static_cast<FEMorphology*>(effect); |
| 124 if (attrName == SVGNames::operatorAttr) | 124 if (attrName == SVGNames::operatorAttr) |
| 125 return morphology->setMorphologyOperator(_operator()); | 125 return morphology->setMorphologyOperator(_operatorCurrentValue()); |
| 126 if (attrName == SVGNames::radiusAttr) { | 126 if (attrName == SVGNames::radiusAttr) { |
| 127 // Both setRadius functions should be evaluated separately. | 127 // Both setRadius functions should be evaluated separately. |
| 128 bool isRadiusXChanged = morphology->setRadiusX(radiusX()); | 128 bool isRadiusXChanged = morphology->setRadiusX(radiusXCurrentValue()); |
| 129 bool isRadiusYChanged = morphology->setRadiusY(radiusY()); | 129 bool isRadiusYChanged = morphology->setRadiusY(radiusYCurrentValue()); |
| 130 return isRadiusXChanged || isRadiusYChanged; | 130 return isRadiusXChanged || isRadiusYChanged; |
| 131 } | 131 } |
| 132 | 132 |
| 133 ASSERT_NOT_REACHED(); | 133 ASSERT_NOT_REACHED(); |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 | 136 |
| 137 void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) | 137 void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) |
| 138 { | 138 { |
| 139 if (!isSupportedAttribute(attrName)) { | 139 if (!isSupportedAttribute(attrName)) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 151 if (attrName == SVGNames::inAttr) { | 151 if (attrName == SVGNames::inAttr) { |
| 152 invalidate(); | 152 invalidate(); |
| 153 return; | 153 return; |
| 154 } | 154 } |
| 155 | 155 |
| 156 ASSERT_NOT_REACHED(); | 156 ASSERT_NOT_REACHED(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterB
uilder, Filter* filter) | 159 PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterB
uilder, Filter* filter) |
| 160 { | 160 { |
| 161 FilterEffect* input1 = filterBuilder->getEffectById(in1()); | 161 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue()); |
| 162 float xRadius = radiusX(); | 162 float xRadius = radiusXCurrentValue(); |
| 163 float yRadius = radiusY(); | 163 float yRadius = radiusYCurrentValue(); |
| 164 | 164 |
| 165 if (!input1) | 165 if (!input1) |
| 166 return 0; | 166 return 0; |
| 167 | 167 |
| 168 if (xRadius < 0 || yRadius < 0) | 168 if (xRadius < 0 || yRadius < 0) |
| 169 return 0; | 169 return 0; |
| 170 | 170 |
| 171 RefPtr<FilterEffect> effect = FEMorphology::create(filter, _operator(), xRad
ius, yRadius); | 171 RefPtr<FilterEffect> effect = FEMorphology::create(filter, _operatorCurrentV
alue(), xRadius, yRadius); |
| 172 effect->inputEffects().append(input1); | 172 effect->inputEffects().append(input1); |
| 173 return effect.release(); | 173 return effect.release(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace WebCore | 176 } // namespace WebCore |
| OLD | NEW |