Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Side by Side Diff: Source/core/svg/SVGFEBlendElement.cpp

Issue 327633004: Apply DEFINE/DECLARE_NODE_FACTORY(T) macro to element factories with single Document& argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGFEBlendElement.h ('k') | Source/core/svg/SVGFEColorMatrixElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFEBlendElement.h ('k') | Source/core/svg/SVGFEColorMatrixElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698