| 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 11 matching lines...) Expand all Loading... |
| 22 #include "core/SVGNames.h" | 22 #include "core/SVGNames.h" |
| 23 #include "core/svg/graphics/filters/SVGFilterBuilder.h" | 23 #include "core/svg/graphics/filters/SVGFilterBuilder.h" |
| 24 | 24 |
| 25 namespace blink { | 25 namespace blink { |
| 26 | 26 |
| 27 template <> | 27 template <> |
| 28 const SVGEnumerationStringEntries& | 28 const SVGEnumerationStringEntries& |
| 29 getStaticStringEntries<MorphologyOperatorType>() { | 29 getStaticStringEntries<MorphologyOperatorType>() { |
| 30 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 30 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
| 31 if (entries.isEmpty()) { | 31 if (entries.isEmpty()) { |
| 32 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_ERODE, "erode")); | 32 entries.push_back(std::make_pair(FEMORPHOLOGY_OPERATOR_ERODE, "erode")); |
| 33 entries.append(std::make_pair(FEMORPHOLOGY_OPERATOR_DILATE, "dilate")); | 33 entries.push_back(std::make_pair(FEMORPHOLOGY_OPERATOR_DILATE, "dilate")); |
| 34 } | 34 } |
| 35 return entries; | 35 return entries; |
| 36 } | 36 } |
| 37 | 37 |
| 38 inline SVGFEMorphologyElement::SVGFEMorphologyElement(Document& document) | 38 inline SVGFEMorphologyElement::SVGFEMorphologyElement(Document& document) |
| 39 : SVGFilterPrimitiveStandardAttributes(SVGNames::feMorphologyTag, document), | 39 : SVGFilterPrimitiveStandardAttributes(SVGNames::feMorphologyTag, document), |
| 40 m_radius( | 40 m_radius( |
| 41 SVGAnimatedNumberOptionalNumber::create(this, SVGNames::radiusAttr)), | 41 SVGAnimatedNumberOptionalNumber::create(this, SVGNames::radiusAttr)), |
| 42 m_in1(SVGAnimatedString::create(this, SVGNames::inAttr)), | 42 m_in1(SVGAnimatedString::create(this, SVGNames::inAttr)), |
| 43 m_svgOperator(SVGAnimatedEnumeration<MorphologyOperatorType>::create( | 43 m_svgOperator(SVGAnimatedEnumeration<MorphologyOperatorType>::create( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // "A negative or zero value disables the effect of the given filter | 105 // "A negative or zero value disables the effect of the given filter |
| 106 // primitive (i.e., the result is the filter input image)." | 106 // primitive (i.e., the result is the filter input image)." |
| 107 // https://drafts.fxtf.org/filters/#element-attrdef-femorphology-radius | 107 // https://drafts.fxtf.org/filters/#element-attrdef-femorphology-radius |
| 108 // | 108 // |
| 109 // (This is handled by FEMorphology) | 109 // (This is handled by FEMorphology) |
| 110 float xRadius = radiusX()->currentValue()->value(); | 110 float xRadius = radiusX()->currentValue()->value(); |
| 111 float yRadius = radiusY()->currentValue()->value(); | 111 float yRadius = radiusY()->currentValue()->value(); |
| 112 FilterEffect* effect = FEMorphology::create( | 112 FilterEffect* effect = FEMorphology::create( |
| 113 filter, m_svgOperator->currentValue()->enumValue(), xRadius, yRadius); | 113 filter, m_svgOperator->currentValue()->enumValue(), xRadius, yRadius); |
| 114 effect->inputEffects().append(input1); | 114 effect->inputEffects().push_back(input1); |
| 115 return effect; | 115 return effect; |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |