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 23 matching lines...) Expand all Loading... |
34 if (entries.isEmpty()) { | 34 if (entries.isEmpty()) { |
35 entries.append(std::make_pair(FEBLEND_MODE_NORMAL, "normal")); | 35 entries.append(std::make_pair(FEBLEND_MODE_NORMAL, "normal")); |
36 entries.append(std::make_pair(FEBLEND_MODE_MULTIPLY, "multiply")); | 36 entries.append(std::make_pair(FEBLEND_MODE_MULTIPLY, "multiply")); |
37 entries.append(std::make_pair(FEBLEND_MODE_SCREEN, "screen")); | 37 entries.append(std::make_pair(FEBLEND_MODE_SCREEN, "screen")); |
38 entries.append(std::make_pair(FEBLEND_MODE_DARKEN, "darken")); | 38 entries.append(std::make_pair(FEBLEND_MODE_DARKEN, "darken")); |
39 entries.append(std::make_pair(FEBLEND_MODE_LIGHTEN, "lighten")); | 39 entries.append(std::make_pair(FEBLEND_MODE_LIGHTEN, "lighten")); |
40 } | 40 } |
41 return entries; | 41 return entries; |
42 } | 42 } |
43 | 43 |
44 SVGFEBlendElement::SVGFEBlendElement(Document& document) | 44 inline SVGFEBlendElement::SVGFEBlendElement(Document& document) |
45 : SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document) | 45 : SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document) |
46 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 46 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
47 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create
())) | 47 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create
())) |
48 , m_mode(SVGAnimatedEnumeration<BlendModeType>::create(this, SVGNames::modeA
ttr, FEBLEND_MODE_NORMAL)) | 48 , m_mode(SVGAnimatedEnumeration<BlendModeType>::create(this, SVGNames::modeA
ttr, FEBLEND_MODE_NORMAL)) |
49 { | 49 { |
50 ScriptWrappable::init(this); | 50 ScriptWrappable::init(this); |
51 addToPropertyMap(m_in1); | 51 addToPropertyMap(m_in1); |
52 addToPropertyMap(m_in2); | 52 addToPropertyMap(m_in2); |
53 addToPropertyMap(m_mode); | 53 addToPropertyMap(m_mode); |
54 } | 54 } |
55 | 55 |
| 56 DEFINE_NODE_FACTORY(SVGFEBlendElement) |
| 57 |
56 bool SVGFEBlendElement::isSupportedAttribute(const QualifiedName& attrName) | 58 bool SVGFEBlendElement::isSupportedAttribute(const QualifiedName& attrName) |
57 { | 59 { |
58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 60 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
59 if (supportedAttributes.isEmpty()) { | 61 if (supportedAttributes.isEmpty()) { |
60 supportedAttributes.add(SVGNames::modeAttr); | 62 supportedAttributes.add(SVGNames::modeAttr); |
61 supportedAttributes.add(SVGNames::inAttr); | 63 supportedAttributes.add(SVGNames::inAttr); |
62 supportedAttributes.add(SVGNames::in2Attr); | 64 supportedAttributes.add(SVGNames::in2Attr); |
63 } | 65 } |
64 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 66 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
65 } | 67 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 129 |
128 RefPtr<FilterEffect> effect = FEBlend::create(filter, m_mode->currentValue()
->enumValue()); | 130 RefPtr<FilterEffect> effect = FEBlend::create(filter, m_mode->currentValue()
->enumValue()); |
129 FilterEffectVector& inputEffects = effect->inputEffects(); | 131 FilterEffectVector& inputEffects = effect->inputEffects(); |
130 inputEffects.reserveCapacity(2); | 132 inputEffects.reserveCapacity(2); |
131 inputEffects.append(input1); | 133 inputEffects.append(input1); |
132 inputEffects.append(input2); | 134 inputEffects.append(input2); |
133 return effect.release(); | 135 return effect.release(); |
134 } | 136 } |
135 | 137 |
136 } | 138 } |
OLD | NEW |