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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 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 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 DEFINE_TRACE(SVGFEComponentTransferElement) | 43 DEFINE_TRACE(SVGFEComponentTransferElement) |
44 { | 44 { |
45 visitor->trace(m_in1); | 45 visitor->trace(m_in1); |
46 SVGFilterPrimitiveStandardAttributes::trace(visitor); | 46 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
47 } | 47 } |
48 | 48 |
49 DEFINE_NODE_FACTORY(SVGFEComponentTransferElement) | 49 DEFINE_NODE_FACTORY(SVGFEComponentTransferElement) |
50 | 50 |
51 bool SVGFEComponentTransferElement::isSupportedAttribute(const QualifiedName& at
trName) | |
52 { | |
53 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | |
54 if (supportedAttributes.isEmpty()) | |
55 supportedAttributes.add(SVGNames::inAttr); | |
56 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | |
57 } | |
58 | |
59 void SVGFEComponentTransferElement::svgAttributeChanged(const QualifiedName& att
rName) | 51 void SVGFEComponentTransferElement::svgAttributeChanged(const QualifiedName& att
rName) |
60 { | 52 { |
61 if (!isSupportedAttribute(attrName)) { | |
62 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | |
63 return; | |
64 } | |
65 | |
66 SVGElement::InvalidationGuard invalidationGuard(this); | |
67 | |
68 if (attrName == SVGNames::inAttr) { | 53 if (attrName == SVGNames::inAttr) { |
| 54 SVGElement::InvalidationGuard invalidationGuard(this); |
69 invalidate(); | 55 invalidate(); |
70 return; | 56 return; |
71 } | 57 } |
72 | 58 |
73 ASSERT_NOT_REACHED(); | 59 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
74 } | 60 } |
75 | 61 |
76 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFil
terBuilder* filterBuilder, Filter* filter) | 62 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFil
terBuilder* filterBuilder, Filter* filter) |
77 { | 63 { |
78 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 64 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
79 | 65 |
80 if (!input1) | 66 if (!input1) |
81 return nullptr; | 67 return nullptr; |
82 | 68 |
83 ComponentTransferFunction red; | 69 ComponentTransferFunction red; |
(...skipping 11 matching lines...) Expand all Loading... |
95 else if (isSVGFEFuncAElement(*element)) | 81 else if (isSVGFEFuncAElement(*element)) |
96 alpha = toSVGFEFuncAElement(*element).transferFunction(); | 82 alpha = toSVGFEFuncAElement(*element).transferFunction(); |
97 } | 83 } |
98 | 84 |
99 RefPtrWillBeRawPtr<FilterEffect> effect = FEComponentTransfer::create(filter
, red, green, blue, alpha); | 85 RefPtrWillBeRawPtr<FilterEffect> effect = FEComponentTransfer::create(filter
, red, green, blue, alpha); |
100 effect->inputEffects().append(input1); | 86 effect->inputEffects().append(input1); |
101 return effect.release(); | 87 return effect.release(); |
102 } | 88 } |
103 | 89 |
104 } | 90 } |
OLD | NEW |