| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 { | 126 { |
| 127 FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect)
; | 127 FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect)
; |
| 128 | 128 |
| 129 if (attrName == SVGNames::lighting_colorAttr) { | 129 if (attrName == SVGNames::lighting_colorAttr) { |
| 130 RenderObject* renderer = this->renderer(); | 130 RenderObject* renderer = this->renderer(); |
| 131 ASSERT(renderer); | 131 ASSERT(renderer); |
| 132 ASSERT(renderer->style()); | 132 ASSERT(renderer->style()); |
| 133 return diffuseLighting->setLightingColor(renderer->style()->svgStyle()->
lightingColor()); | 133 return diffuseLighting->setLightingColor(renderer->style()->svgStyle()->
lightingColor()); |
| 134 } | 134 } |
| 135 if (attrName == SVGNames::surfaceScaleAttr) | 135 if (attrName == SVGNames::surfaceScaleAttr) |
| 136 return diffuseLighting->setSurfaceScale(surfaceScale()); | 136 return diffuseLighting->setSurfaceScale(surfaceScaleCurrentValue()); |
| 137 if (attrName == SVGNames::diffuseConstantAttr) | 137 if (attrName == SVGNames::diffuseConstantAttr) |
| 138 return diffuseLighting->setDiffuseConstant(diffuseConstant()); | 138 return diffuseLighting->setDiffuseConstant(diffuseConstantCurrentValue()
); |
| 139 | 139 |
| 140 LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSo
urce()); | 140 LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSo
urce()); |
| 141 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(
this); | 141 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(
this); |
| 142 ASSERT(lightSource); | 142 ASSERT(lightSource); |
| 143 ASSERT(lightElement); | 143 ASSERT(lightElement); |
| 144 | 144 |
| 145 if (attrName == SVGNames::azimuthAttr) | 145 if (attrName == SVGNames::azimuthAttr) |
| 146 return lightSource->setAzimuth(lightElement->azimuth()); | 146 return lightSource->setAzimuth(lightElement->azimuthCurrentValue()); |
| 147 if (attrName == SVGNames::elevationAttr) | 147 if (attrName == SVGNames::elevationAttr) |
| 148 return lightSource->setElevation(lightElement->elevation()); | 148 return lightSource->setElevation(lightElement->elevationCurrentValue()); |
| 149 if (attrName == SVGNames::xAttr) | 149 if (attrName == SVGNames::xAttr) |
| 150 return lightSource->setX(lightElement->x()); | 150 return lightSource->setX(lightElement->xCurrentValue()); |
| 151 if (attrName == SVGNames::yAttr) | 151 if (attrName == SVGNames::yAttr) |
| 152 return lightSource->setY(lightElement->y()); | 152 return lightSource->setY(lightElement->yCurrentValue()); |
| 153 if (attrName == SVGNames::zAttr) | 153 if (attrName == SVGNames::zAttr) |
| 154 return lightSource->setZ(lightElement->z()); | 154 return lightSource->setZ(lightElement->zCurrentValue()); |
| 155 if (attrName == SVGNames::pointsAtXAttr) | 155 if (attrName == SVGNames::pointsAtXAttr) |
| 156 return lightSource->setPointsAtX(lightElement->pointsAtX()); | 156 return lightSource->setPointsAtX(lightElement->pointsAtXCurrentValue()); |
| 157 if (attrName == SVGNames::pointsAtYAttr) | 157 if (attrName == SVGNames::pointsAtYAttr) |
| 158 return lightSource->setPointsAtY(lightElement->pointsAtY()); | 158 return lightSource->setPointsAtY(lightElement->pointsAtYCurrentValue()); |
| 159 if (attrName == SVGNames::pointsAtZAttr) | 159 if (attrName == SVGNames::pointsAtZAttr) |
| 160 return lightSource->setPointsAtZ(lightElement->pointsAtZ()); | 160 return lightSource->setPointsAtZ(lightElement->pointsAtZCurrentValue()); |
| 161 if (attrName == SVGNames::specularExponentAttr) | 161 if (attrName == SVGNames::specularExponentAttr) |
| 162 return lightSource->setSpecularExponent(lightElement->specularExponent()
); | 162 return lightSource->setSpecularExponent(lightElement->specularExponentCu
rrentValue()); |
| 163 if (attrName == SVGNames::limitingConeAngleAttr) | 163 if (attrName == SVGNames::limitingConeAngleAttr) |
| 164 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
()); | 164 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
CurrentValue()); |
| 165 | 165 |
| 166 ASSERT_NOT_REACHED(); | 166 ASSERT_NOT_REACHED(); |
| 167 return false; | 167 return false; |
| 168 } | 168 } |
| 169 | 169 |
| 170 void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrN
ame) | 170 void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrN
ame) |
| 171 { | 171 { |
| 172 if (!isSupportedAttribute(attrName)) { | 172 if (!isSupportedAttribute(attrName)) { |
| 173 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 173 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
| 174 return; | 174 return; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 196 { | 196 { |
| 197 if (SVGFELightElement::findLightElement(this) != lightElement) | 197 if (SVGFELightElement::findLightElement(this) != lightElement) |
| 198 return; | 198 return; |
| 199 | 199 |
| 200 // The light element has different attribute names. | 200 // The light element has different attribute names. |
| 201 primitiveAttributeChanged(attrName); | 201 primitiveAttributeChanged(attrName); |
| 202 } | 202 } |
| 203 | 203 |
| 204 PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
lterBuilder, Filter* filter) | 204 PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
lterBuilder, Filter* filter) |
| 205 { | 205 { |
| 206 FilterEffect* input1 = filterBuilder->getEffectById(in1()); | 206 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue()); |
| 207 | 207 |
| 208 if (!input1) | 208 if (!input1) |
| 209 return 0; | 209 return 0; |
| 210 | 210 |
| 211 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this); | 211 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this); |
| 212 if (!lightSource) | 212 if (!lightSource) |
| 213 return 0; | 213 return 0; |
| 214 | 214 |
| 215 RenderObject* renderer = this->renderer(); | 215 RenderObject* renderer = this->renderer(); |
| 216 if (!renderer) | 216 if (!renderer) |
| 217 return 0; | 217 return 0; |
| 218 | 218 |
| 219 ASSERT(renderer->style()); | 219 ASSERT(renderer->style()); |
| 220 Color color = renderer->style()->svgStyle()->lightingColor(); | 220 Color color = renderer->style()->svgStyle()->lightingColor(); |
| 221 | 221 |
| 222 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfa
ceScale(), diffuseConstant(), | 222 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfa
ceScaleCurrentValue(), diffuseConstantCurrentValue(), |
| 223 kernelUnitLength
X(), kernelUnitLengthY(), lightSource.release()); | 223 kernelUnitLengthXCurrentValue(), kernelUnitLengthYCurrentValue(), lightS
ource.release()); |
| 224 effect->inputEffects().append(input1); | 224 effect->inputEffects().append(input1); |
| 225 return effect.release(); | 225 return effect.release(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } | 228 } |
| OLD | NEW |