OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
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 24 matching lines...) Expand all Loading... |
35 { | 35 { |
36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
37 if (entries.isEmpty()) { | 37 if (entries.isEmpty()) { |
38 entries.append(std::make_pair(EDGEMODE_DUPLICATE, "duplicate")); | 38 entries.append(std::make_pair(EDGEMODE_DUPLICATE, "duplicate")); |
39 entries.append(std::make_pair(EDGEMODE_WRAP, "wrap")); | 39 entries.append(std::make_pair(EDGEMODE_WRAP, "wrap")); |
40 entries.append(std::make_pair(EDGEMODE_NONE, "none")); | 40 entries.append(std::make_pair(EDGEMODE_NONE, "none")); |
41 } | 41 } |
42 return entries; | 42 return entries; |
43 } | 43 } |
44 | 44 |
45 SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(Document& document) | 45 inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(Document& document
) |
46 : SVGFilterPrimitiveStandardAttributes(SVGNames::feConvolveMatrixTag, docume
nt) | 46 : SVGFilterPrimitiveStandardAttributes(SVGNames::feConvolveMatrixTag, docume
nt) |
47 , m_bias(SVGAnimatedNumber::create(this, SVGNames::biasAttr, SVGNumber::crea
te())) | 47 , m_bias(SVGAnimatedNumber::create(this, SVGNames::biasAttr, SVGNumber::crea
te())) |
48 , m_divisor(SVGAnimatedNumber::create(this, SVGNames::divisorAttr, SVGNumber
::create())) | 48 , m_divisor(SVGAnimatedNumber::create(this, SVGNames::divisorAttr, SVGNumber
::create())) |
49 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 49 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
50 , m_edgeMode(SVGAnimatedEnumeration<EdgeModeType>::create(this, SVGNames::ed
geModeAttr, EDGEMODE_DUPLICATE)) | 50 , m_edgeMode(SVGAnimatedEnumeration<EdgeModeType>::create(this, SVGNames::ed
geModeAttr, EDGEMODE_DUPLICATE)) |
51 , m_kernelMatrix(SVGAnimatedNumberList::create(this, SVGNames::kernelMatrixA
ttr, SVGNumberList::create())) | 51 , m_kernelMatrix(SVGAnimatedNumberList::create(this, SVGNames::kernelMatrixA
ttr, SVGNumberList::create())) |
52 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:kernelUnitLengthAttr)) | 52 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:kernelUnitLengthAttr)) |
53 , m_order(SVGAnimatedIntegerOptionalInteger::create(this, SVGNames::orderAtt
r)) | 53 , m_order(SVGAnimatedIntegerOptionalInteger::create(this, SVGNames::orderAtt
r)) |
54 , m_preserveAlpha(SVGAnimatedBoolean::create(this, SVGNames::preserveAlphaAt
tr, SVGBoolean::create())) | 54 , m_preserveAlpha(SVGAnimatedBoolean::create(this, SVGNames::preserveAlphaAt
tr, SVGBoolean::create())) |
55 , m_targetX(SVGAnimatedInteger::create(this, SVGNames::targetXAttr, SVGInteg
er::create())) | 55 , m_targetX(SVGAnimatedInteger::create(this, SVGNames::targetXAttr, SVGInteg
er::create())) |
56 , m_targetY(SVGAnimatedInteger::create(this, SVGNames::targetYAttr, SVGInteg
er::create())) | 56 , m_targetY(SVGAnimatedInteger::create(this, SVGNames::targetYAttr, SVGInteg
er::create())) |
57 { | 57 { |
58 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
59 | 59 |
60 addToPropertyMap(m_preserveAlpha); | 60 addToPropertyMap(m_preserveAlpha); |
61 addToPropertyMap(m_divisor); | 61 addToPropertyMap(m_divisor); |
62 addToPropertyMap(m_bias); | 62 addToPropertyMap(m_bias); |
63 addToPropertyMap(m_kernelUnitLength); | 63 addToPropertyMap(m_kernelUnitLength); |
64 addToPropertyMap(m_kernelMatrix); | 64 addToPropertyMap(m_kernelMatrix); |
65 addToPropertyMap(m_in1); | 65 addToPropertyMap(m_in1); |
66 addToPropertyMap(m_edgeMode); | 66 addToPropertyMap(m_edgeMode); |
67 addToPropertyMap(m_order); | 67 addToPropertyMap(m_order); |
68 addToPropertyMap(m_targetX); | 68 addToPropertyMap(m_targetX); |
69 addToPropertyMap(m_targetY); | 69 addToPropertyMap(m_targetY); |
70 } | 70 } |
71 | 71 |
| 72 DEFINE_NODE_FACTORY(SVGFEConvolveMatrixElement) |
| 73 |
72 bool SVGFEConvolveMatrixElement::isSupportedAttribute(const QualifiedName& attrN
ame) | 74 bool SVGFEConvolveMatrixElement::isSupportedAttribute(const QualifiedName& attrN
ame) |
73 { | 75 { |
74 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 76 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
75 if (supportedAttributes.isEmpty()) { | 77 if (supportedAttributes.isEmpty()) { |
76 supportedAttributes.add(SVGNames::inAttr); | 78 supportedAttributes.add(SVGNames::inAttr); |
77 supportedAttributes.add(SVGNames::orderAttr); | 79 supportedAttributes.add(SVGNames::orderAttr); |
78 supportedAttributes.add(SVGNames::kernelMatrixAttr); | 80 supportedAttributes.add(SVGNames::kernelMatrixAttr); |
79 supportedAttributes.add(SVGNames::edgeModeAttr); | 81 supportedAttributes.add(SVGNames::edgeModeAttr); |
80 supportedAttributes.add(SVGNames::divisorAttr); | 82 supportedAttributes.add(SVGNames::divisorAttr); |
81 supportedAttributes.add(SVGNames::biasAttr); | 83 supportedAttributes.add(SVGNames::biasAttr); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 239 |
238 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, | 240 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, |
239 IntSize(orderXValue, orderYValue), divisorValue, | 241 IntSize(orderXValue, orderYValue), divisorValue, |
240 m_bias->currentValue()->value(), IntPoint(targetXValue, targ
etYValue), m_edgeMode->currentValue()->enumValue(), | 242 m_bias->currentValue()->value(), IntPoint(targetXValue, targ
etYValue), m_edgeMode->currentValue()->enumValue(), |
241 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloa
tVector()); | 243 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloa
tVector()); |
242 effect->inputEffects().append(input1); | 244 effect->inputEffects().append(input1); |
243 return effect.release(); | 245 return effect.release(); |
244 } | 246 } |
245 | 247 |
246 } // namespace WebCore | 248 } // namespace WebCore |
OLD | NEW |