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

Side by Side Diff: Source/core/svg/SVGFECompositeElement.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/SVGFECompositeElement.h ('k') | Source/core/svg/SVGFEConvolveMatrixElement.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 24 matching lines...) Expand all
35 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_OVER, "over")); 35 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_OVER, "over"));
36 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_IN, "in")); 36 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_IN, "in"));
37 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_OUT, "out")); 37 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_OUT, "out"));
38 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_ATOP, "atop")); 38 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_ATOP, "atop"));
39 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_XOR, "xor")); 39 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_XOR, "xor"));
40 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_ARITHMETIC, "arithmet ic")); 40 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_ARITHMETIC, "arithmet ic"));
41 } 41 }
42 return entries; 42 return entries;
43 } 43 }
44 44
45 SVGFECompositeElement::SVGFECompositeElement(Document& document) 45 inline SVGFECompositeElement::SVGFECompositeElement(Document& document)
46 : SVGFilterPrimitiveStandardAttributes(SVGNames::feCompositeTag, document) 46 : SVGFilterPrimitiveStandardAttributes(SVGNames::feCompositeTag, document)
47 , m_k1(SVGAnimatedNumber::create(this, SVGNames::k1Attr, SVGNumber::create() )) 47 , m_k1(SVGAnimatedNumber::create(this, SVGNames::k1Attr, SVGNumber::create() ))
48 , m_k2(SVGAnimatedNumber::create(this, SVGNames::k2Attr, SVGNumber::create() )) 48 , m_k2(SVGAnimatedNumber::create(this, SVGNames::k2Attr, SVGNumber::create() ))
49 , m_k3(SVGAnimatedNumber::create(this, SVGNames::k3Attr, SVGNumber::create() )) 49 , m_k3(SVGAnimatedNumber::create(this, SVGNames::k3Attr, SVGNumber::create() ))
50 , m_k4(SVGAnimatedNumber::create(this, SVGNames::k4Attr, SVGNumber::create() )) 50 , m_k4(SVGAnimatedNumber::create(this, SVGNames::k4Attr, SVGNumber::create() ))
51 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( ))) 51 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( )))
52 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ())) 52 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ()))
53 , m_svgOperator(SVGAnimatedEnumeration<CompositeOperationType>::create(this, SVGNames::operatorAttr, FECOMPOSITE_OPERATOR_OVER)) 53 , m_svgOperator(SVGAnimatedEnumeration<CompositeOperationType>::create(this, SVGNames::operatorAttr, FECOMPOSITE_OPERATOR_OVER))
54 { 54 {
55 ScriptWrappable::init(this); 55 ScriptWrappable::init(this);
56 56
57 addToPropertyMap(m_k1); 57 addToPropertyMap(m_k1);
58 addToPropertyMap(m_k2); 58 addToPropertyMap(m_k2);
59 addToPropertyMap(m_k3); 59 addToPropertyMap(m_k3);
60 addToPropertyMap(m_k4); 60 addToPropertyMap(m_k4);
61 addToPropertyMap(m_in1); 61 addToPropertyMap(m_in1);
62 addToPropertyMap(m_in2); 62 addToPropertyMap(m_in2);
63 addToPropertyMap(m_svgOperator); 63 addToPropertyMap(m_svgOperator);
64 } 64 }
65 65
66 DEFINE_NODE_FACTORY(SVGFECompositeElement)
67
66 bool SVGFECompositeElement::isSupportedAttribute(const QualifiedName& attrName) 68 bool SVGFECompositeElement::isSupportedAttribute(const QualifiedName& attrName)
67 { 69 {
68 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 70 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
69 if (supportedAttributes.isEmpty()) { 71 if (supportedAttributes.isEmpty()) {
70 supportedAttributes.add(SVGNames::inAttr); 72 supportedAttributes.add(SVGNames::inAttr);
71 supportedAttributes.add(SVGNames::in2Attr); 73 supportedAttributes.add(SVGNames::in2Attr);
72 supportedAttributes.add(SVGNames::operatorAttr); 74 supportedAttributes.add(SVGNames::operatorAttr);
73 supportedAttributes.add(SVGNames::k1Attr); 75 supportedAttributes.add(SVGNames::k1Attr);
74 supportedAttributes.add(SVGNames::k2Attr); 76 supportedAttributes.add(SVGNames::k2Attr);
75 supportedAttributes.add(SVGNames::k3Attr); 77 supportedAttributes.add(SVGNames::k3Attr);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 164
163 RefPtr<FilterEffect> effect = FEComposite::create(filter, m_svgOperator->cur rentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->currentValue()->v alue(), m_k3->currentValue()->value(), m_k4->currentValue()->value()); 165 RefPtr<FilterEffect> effect = FEComposite::create(filter, m_svgOperator->cur rentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->currentValue()->v alue(), m_k3->currentValue()->value(), m_k4->currentValue()->value());
164 FilterEffectVector& inputEffects = effect->inputEffects(); 166 FilterEffectVector& inputEffects = effect->inputEffects();
165 inputEffects.reserveCapacity(2); 167 inputEffects.reserveCapacity(2);
166 inputEffects.append(input1); 168 inputEffects.append(input1);
167 inputEffects.append(input2); 169 inputEffects.append(input2);
168 return effect.release(); 170 return effect.release();
169 } 171 }
170 172
171 } 173 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFECompositeElement.h ('k') | Source/core/svg/SVGFEConvolveMatrixElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698