| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> | 2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 supportedAttributes.add(SVGNames::in2Attr); | 64 supportedAttributes.add(SVGNames::in2Attr); |
| 65 supportedAttributes.add(SVGNames::xChannelSelectorAttr); | 65 supportedAttributes.add(SVGNames::xChannelSelectorAttr); |
| 66 supportedAttributes.add(SVGNames::yChannelSelectorAttr); | 66 supportedAttributes.add(SVGNames::yChannelSelectorAttr); |
| 67 supportedAttributes.add(SVGNames::scaleAttr); | 67 supportedAttributes.add(SVGNames::scaleAttr); |
| 68 } | 68 } |
| 69 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 69 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, cons
t AtomicString& value) | 72 void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, cons
t AtomicString& value) |
| 73 { | 73 { |
| 74 if (!isSupportedAttribute(name)) { | 74 parseAttributeNew(name, value); |
| 75 SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); | |
| 76 return; | |
| 77 } | |
| 78 | |
| 79 SVGParsingError parseError = NoError; | |
| 80 | |
| 81 if (name == SVGNames::inAttr) | |
| 82 m_in1->setBaseValueAsString(value, parseError); | |
| 83 else if (name == SVGNames::in2Attr) | |
| 84 m_in2->setBaseValueAsString(value, parseError); | |
| 85 else if (name == SVGNames::scaleAttr) | |
| 86 m_scale->setBaseValueAsString(value, parseError); | |
| 87 else if (name == SVGNames::xChannelSelectorAttr) | |
| 88 m_xChannelSelector->setBaseValueAsString(value, parseError); | |
| 89 else if (name == SVGNames::yChannelSelectorAttr) | |
| 90 m_yChannelSelector->setBaseValueAsString(value, parseError); | |
| 91 else | |
| 92 ASSERT_NOT_REACHED(); | |
| 93 | |
| 94 reportAttributeParsingError(parseError, name, value); | |
| 95 } | 75 } |
| 96 | 76 |
| 97 bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) | 77 bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) |
| 98 { | 78 { |
| 99 FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect)
; | 79 FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect)
; |
| 100 if (attrName == SVGNames::xChannelSelectorAttr) | 80 if (attrName == SVGNames::xChannelSelectorAttr) |
| 101 return displacementMap->setXChannelSelector(m_xChannelSelector->currentV
alue()->enumValue()); | 81 return displacementMap->setXChannelSelector(m_xChannelSelector->currentV
alue()->enumValue()); |
| 102 if (attrName == SVGNames::yChannelSelectorAttr) | 82 if (attrName == SVGNames::yChannelSelectorAttr) |
| 103 return displacementMap->setYChannelSelector(m_yChannelSelector->currentV
alue()->enumValue()); | 83 return displacementMap->setYChannelSelector(m_yChannelSelector->currentV
alue()->enumValue()); |
| 104 if (attrName == SVGNames::scaleAttr) | 84 if (attrName == SVGNames::scaleAttr) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 120 |
| 141 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSe
lector->currentValue()->enumValue(), m_yChannelSelector->currentValue()->enumVal
ue(), m_scale->currentValue()->value()); | 121 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSe
lector->currentValue()->enumValue(), m_yChannelSelector->currentValue()->enumVal
ue(), m_scale->currentValue()->value()); |
| 142 FilterEffectVector& inputEffects = effect->inputEffects(); | 122 FilterEffectVector& inputEffects = effect->inputEffects(); |
| 143 inputEffects.reserveCapacity(2); | 123 inputEffects.reserveCapacity(2); |
| 144 inputEffects.append(input1); | 124 inputEffects.append(input1); |
| 145 inputEffects.append(input2); | 125 inputEffects.append(input2); |
| 146 return effect.release(); | 126 return effect.release(); |
| 147 } | 127 } |
| 148 | 128 |
| 149 } // namespace blink | 129 } // namespace blink |
| OLD | NEW |