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 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com> | 4 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #include "core/svg/SVGFESpecularLightingElement.h" | 24 #include "core/svg/SVGFESpecularLightingElement.h" |
25 | 25 |
26 #include "platform/graphics/filters/FilterEffect.h" | 26 #include "platform/graphics/filters/FilterEffect.h" |
27 #include "core/rendering/style/RenderStyle.h" | 27 #include "core/rendering/style/RenderStyle.h" |
28 #include "core/svg/SVGParserUtilities.h" | 28 #include "core/svg/SVGParserUtilities.h" |
29 #include "core/svg/graphics/filters/SVGFilterBuilder.h" | 29 #include "core/svg/graphics/filters/SVGFilterBuilder.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 SVGFESpecularLightingElement::SVGFESpecularLightingElement(Document& document) | 33 inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(Document& docu
ment) |
34 : SVGFilterPrimitiveStandardAttributes(SVGNames::feSpecularLightingTag, docu
ment) | 34 : SVGFilterPrimitiveStandardAttributes(SVGNames::feSpecularLightingTag, docu
ment) |
35 , m_specularConstant(SVGAnimatedNumber::create(this, SVGNames::specularConst
antAttr, SVGNumber::create(1))) | 35 , m_specularConstant(SVGAnimatedNumber::create(this, SVGNames::specularConst
antAttr, SVGNumber::create(1))) |
36 , m_specularExponent(SVGAnimatedNumber::create(this, SVGNames::specularExpon
entAttr, SVGNumber::create(1))) | 36 , m_specularExponent(SVGAnimatedNumber::create(this, SVGNames::specularExpon
entAttr, SVGNumber::create(1))) |
37 , m_surfaceScale(SVGAnimatedNumber::create(this, SVGNames::surfaceScaleAttr,
SVGNumber::create(1))) | 37 , m_surfaceScale(SVGAnimatedNumber::create(this, SVGNames::surfaceScaleAttr,
SVGNumber::create(1))) |
38 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:surfaceScaleAttr)) | 38 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:surfaceScaleAttr)) |
39 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 39 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
40 { | 40 { |
41 ScriptWrappable::init(this); | 41 ScriptWrappable::init(this); |
42 | 42 |
43 addToPropertyMap(m_specularConstant); | 43 addToPropertyMap(m_specularConstant); |
44 addToPropertyMap(m_specularExponent); | 44 addToPropertyMap(m_specularExponent); |
45 addToPropertyMap(m_surfaceScale); | 45 addToPropertyMap(m_surfaceScale); |
46 addToPropertyMap(m_kernelUnitLength); | 46 addToPropertyMap(m_kernelUnitLength); |
47 addToPropertyMap(m_in1); | 47 addToPropertyMap(m_in1); |
48 } | 48 } |
49 | 49 |
| 50 DEFINE_NODE_FACTORY(SVGFESpecularLightingElement) |
| 51 |
50 bool SVGFESpecularLightingElement::isSupportedAttribute(const QualifiedName& att
rName) | 52 bool SVGFESpecularLightingElement::isSupportedAttribute(const QualifiedName& att
rName) |
51 { | 53 { |
52 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 54 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
53 if (supportedAttributes.isEmpty()) { | 55 if (supportedAttributes.isEmpty()) { |
54 supportedAttributes.add(SVGNames::inAttr); | 56 supportedAttributes.add(SVGNames::inAttr); |
55 supportedAttributes.add(SVGNames::specularConstantAttr); | 57 supportedAttributes.add(SVGNames::specularConstantAttr); |
56 supportedAttributes.add(SVGNames::specularExponentAttr); | 58 supportedAttributes.add(SVGNames::specularExponentAttr); |
57 supportedAttributes.add(SVGNames::surfaceScaleAttr); | 59 supportedAttributes.add(SVGNames::surfaceScaleAttr); |
58 supportedAttributes.add(SVGNames::kernelUnitLengthAttr); | 60 supportedAttributes.add(SVGNames::kernelUnitLengthAttr); |
59 } | 61 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 ASSERT(renderer->style()); | 186 ASSERT(renderer->style()); |
185 Color color = renderer->style()->svgStyle()->lightingColor(); | 187 Color color = renderer->style()->svgStyle()->lightingColor(); |
186 | 188 |
187 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, | 189 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, |
188 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); | 190 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); |
189 effect->inputEffects().append(input1); | 191 effect->inputEffects().append(input1); |
190 return effect.release(); | 192 return effect.release(); |
191 } | 193 } |
192 | 194 |
193 } | 195 } |
OLD | NEW |