| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 if (attrName == SVGNames::surfaceScaleAttr) | 65 if (attrName == SVGNames::surfaceScaleAttr) |
| 66 return diffuseLighting->setSurfaceScale(m_surfaceScale->currentValue()->
value()); | 66 return diffuseLighting->setSurfaceScale(m_surfaceScale->currentValue()->
value()); |
| 67 if (attrName == SVGNames::diffuseConstantAttr) | 67 if (attrName == SVGNames::diffuseConstantAttr) |
| 68 return diffuseLighting->setDiffuseConstant(m_diffuseConstant->currentVal
ue()->value()); | 68 return diffuseLighting->setDiffuseConstant(m_diffuseConstant->currentVal
ue()->value()); |
| 69 | 69 |
| 70 LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSo
urce()); | 70 LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSo
urce()); |
| 71 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(
*this); | 71 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(
*this); |
| 72 ASSERT(lightSource); | 72 ASSERT(lightSource); |
| 73 ASSERT(lightElement); | 73 ASSERT(lightElement); |
| 74 ASSERT(effect->filter()); | 74 ASSERT(effect->getFilter()); |
| 75 | 75 |
| 76 if (attrName == SVGNames::azimuthAttr) | 76 if (attrName == SVGNames::azimuthAttr) |
| 77 return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->
value()); | 77 return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->
value()); |
| 78 if (attrName == SVGNames::elevationAttr) | 78 if (attrName == SVGNames::elevationAttr) |
| 79 return lightSource->setElevation(lightElement->elevation()->currentValue
()->value()); | 79 return lightSource->setElevation(lightElement->elevation()->currentValue
()->value()); |
| 80 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName =
= SVGNames::zAttr) | 80 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName =
= SVGNames::zAttr) |
| 81 return lightSource->setPosition(effect->filter()->resolve3dPoint(lightEl
ement->position())); | 81 return lightSource->setPosition(effect->getFilter()->resolve3dPoint(ligh
tElement->position())); |
| 82 if (attrName == SVGNames::pointsAtXAttr || attrName == SVGNames::pointsAtYAt
tr || attrName == SVGNames::pointsAtZAttr) | 82 if (attrName == SVGNames::pointsAtXAttr || attrName == SVGNames::pointsAtYAt
tr || attrName == SVGNames::pointsAtZAttr) |
| 83 return lightSource->setPointsAt(effect->filter()->resolve3dPoint(lightEl
ement->pointsAt())); | 83 return lightSource->setPointsAt(effect->getFilter()->resolve3dPoint(ligh
tElement->pointsAt())); |
| 84 if (attrName == SVGNames::specularExponentAttr) | 84 if (attrName == SVGNames::specularExponentAttr) |
| 85 return lightSource->setSpecularExponent(lightElement->specularExponent()
->currentValue()->value()); | 85 return lightSource->setSpecularExponent(lightElement->specularExponent()
->currentValue()->value()); |
| 86 if (attrName == SVGNames::limitingConeAngleAttr) | 86 if (attrName == SVGNames::limitingConeAngleAttr) |
| 87 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
()->currentValue()->value()); | 87 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle
()->currentValue()->value()); |
| 88 | 88 |
| 89 ASSERT_NOT_REACHED(); | 89 ASSERT_NOT_REACHED(); |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrN
ame) | 93 void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrN
ame) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, | 136 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, |
| 137 color, | 137 color, |
| 138 m_surfaceScale->currentValue()->value(), | 138 m_surfaceScale->currentValue()->value(), |
| 139 m_diffuseConstant->currentValue()->value(), | 139 m_diffuseConstant->currentValue()->value(), |
| 140 lightSource.release()); | 140 lightSource.release()); |
| 141 effect->inputEffects().append(input1); | 141 effect->inputEffects().append(input1); |
| 142 return effect.release(); | 142 return effect.release(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace blink | 145 } // namespace blink |
| OLD | NEW |