OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 inline SVGFETurbulenceElement::SVGFETurbulenceElement(Document& document) | 50 inline SVGFETurbulenceElement::SVGFETurbulenceElement(Document& document) |
51 : SVGFilterPrimitiveStandardAttributes(SVGNames::feTurbulenceTag, document) | 51 : SVGFilterPrimitiveStandardAttributes(SVGNames::feTurbulenceTag, document) |
52 , m_baseFrequency(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::ba
seFrequencyAttr)) | 52 , m_baseFrequency(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::ba
seFrequencyAttr)) |
53 , m_seed(SVGAnimatedNumber::create(this, SVGNames::seedAttr, SVGNumber::crea
te(0))) | 53 , m_seed(SVGAnimatedNumber::create(this, SVGNames::seedAttr, SVGNumber::crea
te(0))) |
54 , m_stitchTiles(SVGAnimatedEnumeration<SVGStitchOptions>::create(this, SVGNa
mes::stitchTilesAttr, SVG_STITCHTYPE_NOSTITCH)) | 54 , m_stitchTiles(SVGAnimatedEnumeration<SVGStitchOptions>::create(this, SVGNa
mes::stitchTilesAttr, SVG_STITCHTYPE_NOSTITCH)) |
55 , m_type(SVGAnimatedEnumeration<TurbulenceType>::create(this, SVGNames::type
Attr, FETURBULENCE_TYPE_TURBULENCE)) | 55 , m_type(SVGAnimatedEnumeration<TurbulenceType>::create(this, SVGNames::type
Attr, FETURBULENCE_TYPE_TURBULENCE)) |
56 , m_numOctaves(SVGAnimatedInteger::create(this, SVGNames::numOctavesAttr, SV
GInteger::create(1))) | 56 , m_numOctaves(SVGAnimatedInteger::create(this, SVGNames::numOctavesAttr, SV
GInteger::create(1))) |
57 { | 57 { |
58 ScriptWrappable::init(this); | |
59 | |
60 addToPropertyMap(m_baseFrequency); | 58 addToPropertyMap(m_baseFrequency); |
61 addToPropertyMap(m_seed); | 59 addToPropertyMap(m_seed); |
62 addToPropertyMap(m_stitchTiles); | 60 addToPropertyMap(m_stitchTiles); |
63 addToPropertyMap(m_type); | 61 addToPropertyMap(m_type); |
64 addToPropertyMap(m_numOctaves); | 62 addToPropertyMap(m_numOctaves); |
65 } | 63 } |
66 | 64 |
67 DEFINE_NODE_FACTORY(SVGFETurbulenceElement) | 65 DEFINE_NODE_FACTORY(SVGFETurbulenceElement) |
68 | 66 |
69 bool SVGFETurbulenceElement::isSupportedAttribute(const QualifiedName& attrName) | 67 bool SVGFETurbulenceElement::isSupportedAttribute(const QualifiedName& attrName) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ASSERT_NOT_REACHED(); | 124 ASSERT_NOT_REACHED(); |
127 } | 125 } |
128 | 126 |
129 PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter
* filter) | 127 PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter
* filter) |
130 { | 128 { |
131 if (baseFrequencyX()->currentValue()->value() < 0 || baseFrequencyY()->curre
ntValue()->value() < 0) | 129 if (baseFrequencyX()->currentValue()->value() < 0 || baseFrequencyY()->curre
ntValue()->value() < 0) |
132 return nullptr; | 130 return nullptr; |
133 return FETurbulence::create(filter, m_type->currentValue()->enumValue(), bas
eFrequencyX()->currentValue()->value(), baseFrequencyY()->currentValue()->value(
), m_numOctaves->currentValue()->value(), m_seed->currentValue()->value(), m_sti
tchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH); | 131 return FETurbulence::create(filter, m_type->currentValue()->enumValue(), bas
eFrequencyX()->currentValue()->value(), baseFrequencyY()->currentValue()->value(
), m_numOctaves->currentValue()->value(), m_seed->currentValue()->value(), m_sti
tchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH); |
134 } | 132 } |
135 | 133 |
136 } | 134 } // namespace blink |
OLD | NEW |