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

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

Issue 779963002: Add the 'lighter' composite operation to feComposite. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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
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 20 matching lines...) Expand all
31 template<> const SVGEnumerationStringEntries& getStaticStringEntries<CompositeOp erationType>() 31 template<> const SVGEnumerationStringEntries& getStaticStringEntries<CompositeOp erationType>()
32 { 32 {
33 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); 33 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ());
34 if (entries.isEmpty()) { 34 if (entries.isEmpty()) {
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 entries.append(std::make_pair(FECOMPOSITE_OPERATOR_LIGHTER, "lighter"));
41 } 42 }
42 return entries; 43 return entries;
43 } 44 }
44 45
46 template<> unsigned short getMaxExposedEnumValue<CompositeOperationType>()
47 {
48 return FECOMPOSITE_OPERATOR_ARITHMETIC;
49 }
50
45 inline SVGFECompositeElement::SVGFECompositeElement(Document& document) 51 inline SVGFECompositeElement::SVGFECompositeElement(Document& document)
46 : SVGFilterPrimitiveStandardAttributes(SVGNames::feCompositeTag, document) 52 : SVGFilterPrimitiveStandardAttributes(SVGNames::feCompositeTag, document)
47 , m_k1(SVGAnimatedNumber::create(this, SVGNames::k1Attr, SVGNumber::create() )) 53 , m_k1(SVGAnimatedNumber::create(this, SVGNames::k1Attr, SVGNumber::create() ))
48 , m_k2(SVGAnimatedNumber::create(this, SVGNames::k2Attr, SVGNumber::create() )) 54 , m_k2(SVGAnimatedNumber::create(this, SVGNames::k2Attr, SVGNumber::create() ))
49 , m_k3(SVGAnimatedNumber::create(this, SVGNames::k3Attr, SVGNumber::create() )) 55 , m_k3(SVGAnimatedNumber::create(this, SVGNames::k3Attr, SVGNumber::create() ))
50 , m_k4(SVGAnimatedNumber::create(this, SVGNames::k4Attr, SVGNumber::create() )) 56 , m_k4(SVGAnimatedNumber::create(this, SVGNames::k4Attr, SVGNumber::create() ))
51 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( ))) 57 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( )))
52 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ())) 58 , m_in2(SVGAnimatedString::create(this, SVGNames::in2Attr, SVGString::create ()))
53 , m_svgOperator(SVGAnimatedEnumeration<CompositeOperationType>::create(this, SVGNames::operatorAttr, FECOMPOSITE_OPERATOR_OVER)) 59 , m_svgOperator(SVGAnimatedEnumeration<CompositeOperationType>::create(this, SVGNames::operatorAttr, FECOMPOSITE_OPERATOR_OVER))
54 { 60 {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 156
151 RefPtrWillBeRawPtr<FilterEffect> effect = FEComposite::create(filter, m_svgO perator->currentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->curre ntValue()->value(), m_k3->currentValue()->value(), m_k4->currentValue()->value() ); 157 RefPtrWillBeRawPtr<FilterEffect> effect = FEComposite::create(filter, m_svgO perator->currentValue()->enumValue(), m_k1->currentValue()->value(), m_k2->curre ntValue()->value(), m_k3->currentValue()->value(), m_k4->currentValue()->value() );
152 FilterEffectVector& inputEffects = effect->inputEffects(); 158 FilterEffectVector& inputEffects = effect->inputEffects();
153 inputEffects.reserveCapacity(2); 159 inputEffects.reserveCapacity(2);
154 inputEffects.append(input1); 160 inputEffects.append(input1);
155 inputEffects.append(input2); 161 inputEffects.append(input2);
156 return effect.release(); 162 return effect.release();
157 } 163 }
158 164
159 } // namespace blink 165 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/svg/filters/feComposite-operator-lighter-expected.html ('k') | Source/platform/graphics/filters/FEComposite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698