| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 supportedAttributes.add(SVGNames::k1Attr); | 73 supportedAttributes.add(SVGNames::k1Attr); |
| 74 supportedAttributes.add(SVGNames::k2Attr); | 74 supportedAttributes.add(SVGNames::k2Attr); |
| 75 supportedAttributes.add(SVGNames::k3Attr); | 75 supportedAttributes.add(SVGNames::k3Attr); |
| 76 supportedAttributes.add(SVGNames::k4Attr); | 76 supportedAttributes.add(SVGNames::k4Attr); |
| 77 } | 77 } |
| 78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) | 81 void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) |
| 82 { | 82 { |
| 83 if (!isSupportedAttribute(name)) { | 83 parseAttributeNew(name, value); |
| 84 SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); | |
| 85 return; | |
| 86 } | |
| 87 | |
| 88 SVGParsingError parseError = NoError; | |
| 89 | |
| 90 if (name == SVGNames::inAttr) | |
| 91 m_in1->setBaseValueAsString(value, parseError); | |
| 92 else if (name == SVGNames::in2Attr) | |
| 93 m_in2->setBaseValueAsString(value, parseError); | |
| 94 else if (name == SVGNames::k1Attr) | |
| 95 m_k1->setBaseValueAsString(value, parseError); | |
| 96 else if (name == SVGNames::k2Attr) | |
| 97 m_k2->setBaseValueAsString(value, parseError); | |
| 98 else if (name == SVGNames::k3Attr) | |
| 99 m_k3->setBaseValueAsString(value, parseError); | |
| 100 else if (name == SVGNames::k4Attr) | |
| 101 m_k4->setBaseValueAsString(value, parseError); | |
| 102 else if (name == SVGNames::operatorAttr) | |
| 103 m_svgOperator->setBaseValueAsString(value, parseError); | |
| 104 else | |
| 105 ASSERT_NOT_REACHED(); | |
| 106 | |
| 107 reportAttributeParsingError(parseError, name, value); | |
| 108 } | 84 } |
| 109 | 85 |
| 110 bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const
QualifiedName& attrName) | 86 bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const
QualifiedName& attrName) |
| 111 { | 87 { |
| 112 FEComposite* composite = static_cast<FEComposite*>(effect); | 88 FEComposite* composite = static_cast<FEComposite*>(effect); |
| 113 if (attrName == SVGNames::operatorAttr) | 89 if (attrName == SVGNames::operatorAttr) |
| 114 return composite->setOperation(m_svgOperator->currentValue()->enumValue(
)); | 90 return composite->setOperation(m_svgOperator->currentValue()->enumValue(
)); |
| 115 if (attrName == SVGNames::k1Attr) | 91 if (attrName == SVGNames::k1Attr) |
| 116 return composite->setK1(m_k1->currentValue()->value()); | 92 return composite->setK1(m_k1->currentValue()->value()); |
| 117 if (attrName == SVGNames::k2Attr) | 93 if (attrName == SVGNames::k2Attr) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 138 |
| 163 RefPtr<FilterEffect> effect = FEComposite::create(filter, m_svgOperator->cur
rentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->currentValue()->v
alue(), m_k3->currentValue()->value(), m_k4->currentValue()->value()); | 139 RefPtr<FilterEffect> effect = FEComposite::create(filter, m_svgOperator->cur
rentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->currentValue()->v
alue(), m_k3->currentValue()->value(), m_k4->currentValue()->value()); |
| 164 FilterEffectVector& inputEffects = effect->inputEffects(); | 140 FilterEffectVector& inputEffects = effect->inputEffects(); |
| 165 inputEffects.reserveCapacity(2); | 141 inputEffects.reserveCapacity(2); |
| 166 inputEffects.append(input1); | 142 inputEffects.append(input1); |
| 167 inputEffects.append(input2); | 143 inputEffects.append(input2); |
| 168 return effect.release(); | 144 return effect.release(); |
| 169 } | 145 } |
| 170 | 146 |
| 171 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |