Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(997)

Side by Side Diff: Source/core/svg/SVGComponentTransferFunctionElement.cpp

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: invalidation guard tweaks Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 if (attrName == SVGNames::typeAttr || attrName == SVGNames::tableValuesAttr
94 SVGElement::svgAttributeChanged(attrName); 79 || attrName == SVGNames::slopeAttr || attrName == SVGNames::interceptAtt r
80 || attrName == SVGNames::amplitudeAttr || attrName == SVGNames::exponent Attr
81 || attrName == SVGNames::offsetAttr) {
82 SVGElement::InvalidationGuard invalidationGuard(this);
83
84 invalidateFilterPrimitiveParent(this);
95 return; 85 return;
96 } 86 }
97 87
98 SVGElement::InvalidationGuard invalidationGuard(this); 88 SVGElement::svgAttributeChanged(attrName);
99
100 invalidateFilterPrimitiveParent(this);
101 } 89 }
102 90
103 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction( ) const 91 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction( ) const
104 { 92 {
105 ComponentTransferFunction func; 93 ComponentTransferFunction func;
106 func.type = m_type->currentValue()->enumValue(); 94 func.type = m_type->currentValue()->enumValue();
107 func.slope = m_slope->currentValue()->value(); 95 func.slope = m_slope->currentValue()->value();
108 func.intercept = m_intercept->currentValue()->value(); 96 func.intercept = m_intercept->currentValue()->value();
109 func.amplitude = m_amplitude->currentValue()->value(); 97 func.amplitude = m_amplitude->currentValue()->value();
110 func.exponent = m_exponent->currentValue()->value(); 98 func.exponent = m_exponent->currentValue()->value();
111 func.offset = m_offset->currentValue()->value(); 99 func.offset = m_offset->currentValue()->value();
112 func.tableValues = m_tableValues->currentValue()->toFloatVector(); 100 func.tableValues = m_tableValues->currentValue()->toFloatVector();
113 return func; 101 return func;
114 } 102 }
115 103
116 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698