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

Side by Side Diff: Source/core/svg/SVGFEDisplacementMapElement.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
OLDNEW
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 21 matching lines...) Expand all
32 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); 32 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ());
33 if (entries.isEmpty()) { 33 if (entries.isEmpty()) {
34 entries.append(std::make_pair(CHANNEL_R, "R")); 34 entries.append(std::make_pair(CHANNEL_R, "R"));
35 entries.append(std::make_pair(CHANNEL_G, "G")); 35 entries.append(std::make_pair(CHANNEL_G, "G"));
36 entries.append(std::make_pair(CHANNEL_B, "B")); 36 entries.append(std::make_pair(CHANNEL_B, "B"));
37 entries.append(std::make_pair(CHANNEL_A, "A")); 37 entries.append(std::make_pair(CHANNEL_A, "A"));
38 } 38 }
39 return entries; 39 return entries;
40 } 40 }
41 41
42 SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(Document& document) 42 inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(Document& docume nt)
43 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDisplacementMapTag, docum ent) 43 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDisplacementMapTag, docum ent)
44 , m_scale(SVGAnimatedNumber::create(this, SVGNames::scaleAttr, SVGNumber::cr eate(0))) 44 , m_scale(SVGAnimatedNumber::create(this, SVGNames::scaleAttr, SVGNumber::cr eate(0)))
45 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( ))) 45 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( )))
46 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ())) 46 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ()))
47 , m_xChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi s, SVGNames::xChannelSelectorAttr, CHANNEL_A)) 47 , m_xChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi s, SVGNames::xChannelSelectorAttr, CHANNEL_A))
48 , m_yChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi s, SVGNames::yChannelSelectorAttr, CHANNEL_A)) 48 , m_yChannelSelector(SVGAnimatedEnumeration<ChannelSelectorType>::create(thi s, SVGNames::yChannelSelectorAttr, CHANNEL_A))
49 { 49 {
50 ScriptWrappable::init(this); 50 ScriptWrappable::init(this);
51 51
52 addToPropertyMap(m_scale); 52 addToPropertyMap(m_scale);
53 addToPropertyMap(m_in1); 53 addToPropertyMap(m_in1);
54 addToPropertyMap(m_in2); 54 addToPropertyMap(m_in2);
55 addToPropertyMap(m_xChannelSelector); 55 addToPropertyMap(m_xChannelSelector);
56 addToPropertyMap(m_yChannelSelector); 56 addToPropertyMap(m_yChannelSelector);
57 } 57 }
58 58
59 DEFINE_NODE_FACTORY(SVGFEDisplacementMapElement)
60
59 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr Name) 61 bool SVGFEDisplacementMapElement::isSupportedAttribute(const QualifiedName& attr Name)
60 { 62 {
61 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
62 if (supportedAttributes.isEmpty()) { 64 if (supportedAttributes.isEmpty()) {
63 supportedAttributes.add(SVGNames::inAttr); 65 supportedAttributes.add(SVGNames::inAttr);
64 supportedAttributes.add(SVGNames::in2Attr); 66 supportedAttributes.add(SVGNames::in2Attr);
65 supportedAttributes.add(SVGNames::xChannelSelectorAttr); 67 supportedAttributes.add(SVGNames::xChannelSelectorAttr);
66 supportedAttributes.add(SVGNames::yChannelSelectorAttr); 68 supportedAttributes.add(SVGNames::yChannelSelectorAttr);
67 supportedAttributes.add(SVGNames::scaleAttr); 69 supportedAttributes.add(SVGNames::scaleAttr);
68 } 70 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 142
141 RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSe lector->currentValue()->enumValue(), m_yChannelSelector->currentValue()->enumVal ue(), m_scale->currentValue()->value()); 143 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(); 144 FilterEffectVector& inputEffects = effect->inputEffects();
143 inputEffects.reserveCapacity(2); 145 inputEffects.reserveCapacity(2);
144 inputEffects.append(input1); 146 inputEffects.append(input1);
145 inputEffects.append(input2); 147 inputEffects.append(input2);
146 return effect.release(); 148 return effect.release();
147 } 149 }
148 150
149 } 151 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFEDisplacementMapElement.h ('k') | Source/core/svg/SVGFEDistantLightElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698