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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 ASSERT_NOT_REACHED(); | 96 ASSERT_NOT_REACHED(); |
97 } | 97 } |
98 | 98 |
99 bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, con
st QualifiedName& attrName) | 99 bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, con
st QualifiedName& attrName) |
100 { | 100 { |
101 FEColorMatrix* colorMatrix = static_cast<FEColorMatrix*>(effect); | 101 FEColorMatrix* colorMatrix = static_cast<FEColorMatrix*>(effect); |
102 if (attrName == SVGNames::typeAttr) | 102 if (attrName == SVGNames::typeAttr) |
103 return colorMatrix->setType(typeCurrentValue()); | 103 return colorMatrix->setType(typeCurrentValue()); |
104 if (attrName == SVGNames::valuesAttr) | 104 if (attrName == SVGNames::valuesAttr) |
105 return colorMatrix->setValues(valuesCurrentValue()); | 105 return colorMatrix->setValues(valuesCurrentValue().toFloatVector()); |
106 | 106 |
107 ASSERT_NOT_REACHED(); | 107 ASSERT_NOT_REACHED(); |
108 return false; | 108 return false; |
109 } | 109 } |
110 | 110 |
111 void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) | 111 void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) |
112 { | 112 { |
113 if (!isSupportedAttribute(attrName)) { | 113 if (!isSupportedAttribute(attrName)) { |
114 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 114 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
115 return; | 115 return; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 case FECOLORMATRIX_TYPE_HUEROTATE: | 150 case FECOLORMATRIX_TYPE_HUEROTATE: |
151 filterValues.append(0); | 151 filterValues.append(0); |
152 break; | 152 break; |
153 case FECOLORMATRIX_TYPE_SATURATE: | 153 case FECOLORMATRIX_TYPE_SATURATE: |
154 filterValues.append(1); | 154 filterValues.append(1); |
155 break; | 155 break; |
156 default: | 156 default: |
157 break; | 157 break; |
158 } | 158 } |
159 } else { | 159 } else { |
160 filterValues = valuesCurrentValue(); | 160 SVGNumberList& values = valuesCurrentValue(); |
161 unsigned size = filterValues.size(); | 161 unsigned size = values.size(); |
162 | 162 |
163 if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20) | 163 if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20) |
164 || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1) | 164 || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1) |
165 || (filterType == FECOLORMATRIX_TYPE_SATURATE && size != 1)) | 165 || (filterType == FECOLORMATRIX_TYPE_SATURATE && size != 1)) |
166 return 0; | 166 return 0; |
| 167 |
| 168 filterValues = values.toFloatVector(); |
167 } | 169 } |
168 | 170 |
169 RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filt
erValues); | 171 RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filt
erValues); |
170 effect->inputEffects().append(input1); | 172 effect->inputEffects().append(input1); |
171 return effect.release(); | 173 return effect.release(); |
172 } | 174 } |
173 | 175 |
174 } // namespace WebCore | 176 } // namespace WebCore |
OLD | NEW |