OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(Document& docume
nt) | 32 inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(Document& docume
nt) |
33 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDiffuseLightingTag, docum
ent) | 33 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDiffuseLightingTag, docum
ent) |
34 , m_diffuseConstant(SVGAnimatedNumber::create(this, SVGNames::diffuseConstan
tAttr, SVGNumber::create(1))) | 34 , m_diffuseConstant(SVGAnimatedNumber::create(this, SVGNames::diffuseConstan
tAttr, SVGNumber::create(1))) |
35 , m_surfaceScale(SVGAnimatedNumber::create(this, SVGNames::surfaceScaleAttr,
SVGNumber::create(1))) | 35 , m_surfaceScale(SVGAnimatedNumber::create(this, SVGNames::surfaceScaleAttr,
SVGNumber::create(1))) |
36 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:kernelUnitLengthAttr)) | 36 , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames:
:kernelUnitLengthAttr)) |
37 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 37 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
38 { | 38 { |
39 ScriptWrappable::init(this); | |
40 | |
41 addToPropertyMap(m_diffuseConstant); | 39 addToPropertyMap(m_diffuseConstant); |
42 addToPropertyMap(m_surfaceScale); | 40 addToPropertyMap(m_surfaceScale); |
43 addToPropertyMap(m_kernelUnitLength); | 41 addToPropertyMap(m_kernelUnitLength); |
44 addToPropertyMap(m_in1); | 42 addToPropertyMap(m_in1); |
45 } | 43 } |
46 | 44 |
47 DEFINE_NODE_FACTORY(SVGFEDiffuseLightingElement) | 45 DEFINE_NODE_FACTORY(SVGFEDiffuseLightingElement) |
48 | 46 |
49 bool SVGFEDiffuseLightingElement::isSupportedAttribute(const QualifiedName& attr
Name) | 47 bool SVGFEDiffuseLightingElement::isSupportedAttribute(const QualifiedName& attr
Name) |
50 { | 48 { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 ASSERT(renderer->style()); | 170 ASSERT(renderer->style()); |
173 Color color = renderer->style()->svgStyle().lightingColor(); | 171 Color color = renderer->style()->svgStyle().lightingColor(); |
174 | 172 |
175 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); | 173 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
176 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_sur
faceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(), | 174 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_sur
faceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(), |
177 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre
ntValue()->value(), lightSource.release()); | 175 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre
ntValue()->value(), lightSource.release()); |
178 effect->inputEffects().append(input1); | 176 effect->inputEffects().append(input1); |
179 return effect.release(); | 177 return effect.release(); |
180 } | 178 } |
181 | 179 |
182 } | 180 } // namespace blink |
OLD | NEW |