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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return specularLighting->setSurfaceScale(m_surfaceScale->currentValue()-
>value()); | 101 return specularLighting->setSurfaceScale(m_surfaceScale->currentValue()-
>value()); |
102 if (attrName == SVGNames::specularConstantAttr) | 102 if (attrName == SVGNames::specularConstantAttr) |
103 return specularLighting->setSpecularConstant(m_specularConstant->current
Value()->value()); | 103 return specularLighting->setSpecularConstant(m_specularConstant->current
Value()->value()); |
104 if (attrName == SVGNames::specularExponentAttr) | 104 if (attrName == SVGNames::specularExponentAttr) |
105 return specularLighting->setSpecularExponent(m_specularExponent->current
Value()->value()); | 105 return specularLighting->setSpecularExponent(m_specularExponent->current
Value()->value()); |
106 | 106 |
107 LightSource* lightSource = const_cast<LightSource*>(specularLighting->lightS
ource()); | 107 LightSource* lightSource = const_cast<LightSource*>(specularLighting->lightS
ource()); |
108 SVGFELightElement* lightElement = SVGFELightElement::findLightElement(*this)
; | 108 SVGFELightElement* lightElement = SVGFELightElement::findLightElement(*this)
; |
109 ASSERT(lightSource); | 109 ASSERT(lightSource); |
110 ASSERT(lightElement); | 110 ASSERT(lightElement); |
| 111 ASSERT(effect->filter()); |
111 | 112 |
112 if (attrName == SVGNames::azimuthAttr) | 113 if (attrName == SVGNames::azimuthAttr) |
113 return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->
value()); | 114 return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->
value()); |
114 if (attrName == SVGNames::elevationAttr) | 115 if (attrName == SVGNames::elevationAttr) |
115 return lightSource->setElevation(lightElement->elevation()->currentValue
()->value()); | 116 return lightSource->setElevation(lightElement->elevation()->currentValue
()->value()); |
116 if (attrName == SVGNames::xAttr) | 117 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName =
= SVGNames::zAttr) |
117 return lightSource->setX(lightElement->x()->currentValue()->value()); | 118 return lightSource->setPosition(effect->filter()->resolve3dPoint(lightEl
ement->position())); |
118 if (attrName == SVGNames::yAttr) | 119 if (attrName == SVGNames::pointsAtXAttr || attrName == SVGNames::pointsAtYAt
tr || attrName == SVGNames::pointsAtZAttr) |
119 return lightSource->setY(lightElement->y()->currentValue()->value()); | 120 return lightSource->setPointsAt(effect->filter()->resolve3dPoint(lightEl
ement->pointsAt())); |
120 if (attrName == SVGNames::zAttr) | |
121 return lightSource->setZ(lightElement->z()->currentValue()->value()); | |
122 if (attrName == SVGNames::pointsAtXAttr) | |
123 return lightSource->setPointsAtX(lightElement->pointsAtX()->currentValue
()->value()); | |
124 if (attrName == SVGNames::pointsAtYAttr) | |
125 return lightSource->setPointsAtY(lightElement->pointsAtY()->currentValue
()->value()); | |
126 if (attrName == SVGNames::pointsAtZAttr) | |
127 return lightSource->setPointsAtZ(lightElement->pointsAtZ()->currentValue
()->value()); | |
128 if (attrName == SVGNames::specularExponentAttr) | 121 if (attrName == SVGNames::specularExponentAttr) |
129 return lightSource->setSpecularExponent(lightElement->specularExponent()
->currentValue()->value()); | 122 return lightSource->setSpecularExponent(lightElement->specularExponent()
->currentValue()->value()); |
130 if (attrName == SVGNames::limitingConeAngleAttr) | 123 if (attrName == SVGNames::limitingConeAngleAttr) |
131 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
()->currentValue()->value()); | 124 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
()->currentValue()->value()); |
132 | 125 |
133 ASSERT_NOT_REACHED(); | 126 ASSERT_NOT_REACHED(); |
134 return false; | 127 return false; |
135 } | 128 } |
136 | 129 |
137 void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attr
Name) | 130 void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attr
Name) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 Color color = renderer->style()->svgStyle().lightingColor(); | 180 Color color = renderer->style()->svgStyle().lightingColor(); |
188 | 181 |
189 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); | 182 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
190 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, | 183 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, |
191 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); | 184 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); |
192 effect->inputEffects().append(input1); | 185 effect->inputEffects().append(input1); |
193 return effect.release(); | 186 return effect.release(); |
194 } | 187 } |
195 | 188 |
196 } | 189 } |
OLD | NEW |