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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 : SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document) | 92 : SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document) |
93 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 93 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
94 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create
())) | 94 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create
())) |
95 , m_mode(SVGAnimatedEnumeration<Mode>::create(this, SVGNames::modeAttr, SVGF
EBlendElement::ModeNormal)) | 95 , m_mode(SVGAnimatedEnumeration<Mode>::create(this, SVGNames::modeAttr, SVGF
EBlendElement::ModeNormal)) |
96 { | 96 { |
97 addToPropertyMap(m_in1); | 97 addToPropertyMap(m_in1); |
98 addToPropertyMap(m_in2); | 98 addToPropertyMap(m_in2); |
99 addToPropertyMap(m_mode); | 99 addToPropertyMap(m_mode); |
100 } | 100 } |
101 | 101 |
| 102 void SVGFEBlendElement::trace(Visitor* visitor) |
| 103 { |
| 104 visitor->trace(m_in1); |
| 105 visitor->trace(m_in2); |
| 106 visitor->trace(m_mode); |
| 107 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
| 108 } |
| 109 |
102 DEFINE_NODE_FACTORY(SVGFEBlendElement) | 110 DEFINE_NODE_FACTORY(SVGFEBlendElement) |
103 | 111 |
104 bool SVGFEBlendElement::isSupportedAttribute(const QualifiedName& attrName) | 112 bool SVGFEBlendElement::isSupportedAttribute(const QualifiedName& attrName) |
105 { | 113 { |
106 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 114 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
107 if (supportedAttributes.isEmpty()) { | 115 if (supportedAttributes.isEmpty()) { |
108 supportedAttributes.add(SVGNames::modeAttr); | 116 supportedAttributes.add(SVGNames::modeAttr); |
109 supportedAttributes.add(SVGNames::inAttr); | 117 supportedAttributes.add(SVGNames::inAttr); |
110 supportedAttributes.add(SVGNames::in2Attr); | 118 supportedAttributes.add(SVGNames::in2Attr); |
111 } | 119 } |
(...skipping 30 matching lines...) Expand all Loading... |
142 } | 150 } |
143 | 151 |
144 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { | 152 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { |
145 invalidate(); | 153 invalidate(); |
146 return; | 154 return; |
147 } | 155 } |
148 | 156 |
149 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
150 } | 158 } |
151 | 159 |
152 PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilde
r, Filter* filter) | 160 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder*
filterBuilder, Filter* filter) |
153 { | 161 { |
154 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 162 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
155 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr
entValue()->value())); | 163 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr
entValue()->value())); |
156 | 164 |
157 if (!input1 || !input2) | 165 if (!input1 || !input2) |
158 return nullptr; | 166 return nullptr; |
159 | 167 |
160 RefPtr<FilterEffect> effect = FEBlend::create(filter, toWebBlendMode(m_mode-
>currentValue()->enumValue())); | 168 RefPtrWillBeRawPtr<FilterEffect> effect = FEBlend::create(filter, toWebBlend
Mode(m_mode->currentValue()->enumValue())); |
161 FilterEffectVector& inputEffects = effect->inputEffects(); | 169 FilterEffectVector& inputEffects = effect->inputEffects(); |
162 inputEffects.reserveCapacity(2); | 170 inputEffects.reserveCapacity(2); |
163 inputEffects.append(input1); | 171 inputEffects.append(input1); |
164 inputEffects.append(input2); | 172 inputEffects.append(input2); |
165 return effect.release(); | 173 return effect.release(); |
166 } | 174 } |
167 | 175 |
168 } | 176 } |
OLD | NEW |