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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 DEFINE_NODE_FACTORY(SVGFEGaussianBlurElement) | 48 DEFINE_NODE_FACTORY(SVGFEGaussianBlurElement) |
49 | 49 |
50 void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) | 50 void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) |
51 { | 51 { |
52 stdDeviationX()->baseValue()->setValue(x); | 52 stdDeviationX()->baseValue()->setValue(x); |
53 stdDeviationY()->baseValue()->setValue(y); | 53 stdDeviationY()->baseValue()->setValue(y); |
54 invalidate(); | 54 invalidate(); |
55 } | 55 } |
56 | 56 |
57 bool SVGFEGaussianBlurElement::isSupportedAttribute(const QualifiedName& attrNam
e) | |
58 { | |
59 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | |
60 if (supportedAttributes.isEmpty()) { | |
61 supportedAttributes.add(SVGNames::inAttr); | |
62 supportedAttributes.add(SVGNames::stdDeviationAttr); | |
63 } | |
64 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | |
65 } | |
66 | |
67 void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName
) | 57 void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName
) |
68 { | 58 { |
69 if (!isSupportedAttribute(attrName)) { | |
70 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | |
71 return; | |
72 } | |
73 | |
74 SVGElement::InvalidationGuard invalidationGuard(this); | |
75 | |
76 if (attrName == SVGNames::inAttr || attrName == SVGNames::stdDeviationAttr)
{ | 59 if (attrName == SVGNames::inAttr || attrName == SVGNames::stdDeviationAttr)
{ |
| 60 SVGElement::InvalidationGuard invalidationGuard(this); |
77 invalidate(); | 61 invalidate(); |
78 return; | 62 return; |
79 } | 63 } |
80 | 64 |
81 ASSERT_NOT_REACHED(); | 65 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
82 } | 66 } |
83 | 67 |
84 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBu
ilder* filterBuilder, Filter* filter) | 68 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBu
ilder* filterBuilder, Filter* filter) |
85 { | 69 { |
86 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 70 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
87 | 71 |
88 if (!input1) | 72 if (!input1) |
89 return nullptr; | 73 return nullptr; |
90 | 74 |
91 if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->current
Value()->value() < 0) | 75 if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->current
Value()->value() < 0) |
92 return nullptr; | 76 return nullptr; |
93 | 77 |
94 RefPtrWillBeRawPtr<FilterEffect> effect = FEGaussianBlur::create(filter, std
DeviationX()->currentValue()->value(), stdDeviationY()->currentValue()->value())
; | 78 RefPtrWillBeRawPtr<FilterEffect> effect = FEGaussianBlur::create(filter, std
DeviationX()->currentValue()->value(), stdDeviationY()->currentValue()->value())
; |
95 effect->inputEffects().append(input1); | 79 effect->inputEffects().append(input1); |
96 return effect.release(); | 80 return effect.release(); |
97 } | 81 } |
98 | 82 |
99 } // namespace blink | 83 } // namespace blink |
OLD | NEW |