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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 visitor->trace(m_tableValues); | 66 visitor->trace(m_tableValues); |
67 visitor->trace(m_slope); | 67 visitor->trace(m_slope); |
68 visitor->trace(m_intercept); | 68 visitor->trace(m_intercept); |
69 visitor->trace(m_amplitude); | 69 visitor->trace(m_amplitude); |
70 visitor->trace(m_exponent); | 70 visitor->trace(m_exponent); |
71 visitor->trace(m_offset); | 71 visitor->trace(m_offset); |
72 visitor->trace(m_type); | 72 visitor->trace(m_type); |
73 SVGElement::trace(visitor); | 73 SVGElement::trace(visitor); |
74 } | 74 } |
75 | 75 |
76 bool SVGComponentTransferFunctionElement::isSupportedAttribute(const QualifiedNa me& attrName) | |
77 { | |
78 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | |
79 if (supportedAttributes.isEmpty()) { | |
80 supportedAttributes.add(SVGNames::typeAttr); | |
81 supportedAttributes.add(SVGNames::tableValuesAttr); | |
82 supportedAttributes.add(SVGNames::slopeAttr); | |
83 supportedAttributes.add(SVGNames::interceptAttr); | |
84 supportedAttributes.add(SVGNames::amplitudeAttr); | |
85 supportedAttributes.add(SVGNames::exponentAttr); | |
86 supportedAttributes.add(SVGNames::offsetAttr); | |
87 } | |
88 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | |
89 } | |
90 | |
91 void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam e& attrName) | 76 void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam e& attrName) |
92 { | 77 { |
93 if (!isSupportedAttribute(attrName)) { | 78 SVGElement::svgAttributeChanged(attrName); |
94 SVGElement::svgAttributeChanged(attrName); | |
95 return; | |
96 } | |
97 | 79 |
98 SVGElement::InvalidationGuard invalidationGuard(this); | 80 SVGElement::InvalidationGuard invalidationGuard(this); |
99 | 81 |
100 invalidateFilterPrimitiveParent(this); | 82 invalidateFilterPrimitiveParent(this); |
fs
2015/04/10 14:25:23
Will now invalidate the filter on every change - p
Erik Dahlström (inactive)
2015/04/10 15:33:43
This was not on purpose, will fix.
| |
101 } | 83 } |
102 | 84 |
103 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction( ) const | 85 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction( ) const |
104 { | 86 { |
105 ComponentTransferFunction func; | 87 ComponentTransferFunction func; |
106 func.type = m_type->currentValue()->enumValue(); | 88 func.type = m_type->currentValue()->enumValue(); |
107 func.slope = m_slope->currentValue()->value(); | 89 func.slope = m_slope->currentValue()->value(); |
108 func.intercept = m_intercept->currentValue()->value(); | 90 func.intercept = m_intercept->currentValue()->value(); |
109 func.amplitude = m_amplitude->currentValue()->value(); | 91 func.amplitude = m_amplitude->currentValue()->value(); |
110 func.exponent = m_exponent->currentValue()->value(); | 92 func.exponent = m_exponent->currentValue()->value(); |
111 func.offset = m_offset->currentValue()->value(); | 93 func.offset = m_offset->currentValue()->value(); |
112 func.tableValues = m_tableValues->currentValue()->toFloatVector(); | 94 func.tableValues = m_tableValues->currentValue()->toFloatVector(); |
113 return func; | 95 return func; |
114 } | 96 } |
115 | 97 |
116 } // namespace blink | 98 } // namespace blink |
OLD | NEW |