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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 invalidate(); | 88 invalidate(); |
89 return; | 89 return; |
90 } | 90 } |
91 | 91 |
92 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 92 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
93 } | 93 } |
94 | 94 |
95 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuil
der* filterBuilder, Filter* filter) | 95 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuil
der* filterBuilder, Filter* filter) |
96 { | 96 { |
97 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 97 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
98 float xRadius = radiusX()->currentValue()->value(); | |
99 float yRadius = radiusY()->currentValue()->value(); | |
100 | 98 |
101 if (!input1) | 99 if (!input1) |
102 return nullptr; | 100 return nullptr; |
103 | 101 |
104 if (xRadius < 0 || yRadius < 0) | 102 // "A negative or zero value disables the effect of the given filter |
105 return nullptr; | 103 // primitive (i.e., the result is the filter input image)." |
106 | 104 // https://drafts.fxtf.org/filters/#element-attrdef-femorphology-radius |
| 105 // |
| 106 // (This is handled by FEMorphology) |
| 107 float xRadius = radiusX()->currentValue()->value(); |
| 108 float yRadius = radiusY()->currentValue()->value(); |
107 RefPtrWillBeRawPtr<FilterEffect> effect = FEMorphology::create(filter, m_svg
Operator->currentValue()->enumValue(), xRadius, yRadius); | 109 RefPtrWillBeRawPtr<FilterEffect> effect = FEMorphology::create(filter, m_svg
Operator->currentValue()->enumValue(), xRadius, yRadius); |
108 effect->inputEffects().append(input1); | 110 effect->inputEffects().append(input1); |
109 return effect.release(); | 111 return effect.release(); |
110 } | 112 } |
111 | 113 |
112 } // namespace blink | 114 } // namespace blink |
OLD | NEW |