Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1582)

Unified Diff: Source/core/svg/SVGFEDiffuseLightingElement.cpp

Issue 395813002: Resolve light-source position/direction when updated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGFEDiffuseLightingElement.cpp
diff --git a/Source/core/svg/SVGFEDiffuseLightingElement.cpp b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
index 6a710b68b5ae42d56b2ef5aea6f922cece3c7b2c..d40cbbc10cc2db0ea9ff274ef16ba53aaa8d534a 100644
--- a/Source/core/svg/SVGFEDiffuseLightingElement.cpp
+++ b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
@@ -101,23 +101,16 @@ bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(*this);
ASSERT(lightSource);
ASSERT(lightElement);
+ ASSERT(effect->filter());
if (attrName == SVGNames::azimuthAttr)
return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->value());
if (attrName == SVGNames::elevationAttr)
return lightSource->setElevation(lightElement->elevation()->currentValue()->value());
- if (attrName == SVGNames::xAttr)
- return lightSource->setX(lightElement->x()->currentValue()->value());
- if (attrName == SVGNames::yAttr)
- return lightSource->setY(lightElement->y()->currentValue()->value());
- if (attrName == SVGNames::zAttr)
- return lightSource->setZ(lightElement->z()->currentValue()->value());
- if (attrName == SVGNames::pointsAtXAttr)
- return lightSource->setPointsAtX(lightElement->pointsAtX()->currentValue()->value());
- if (attrName == SVGNames::pointsAtYAttr)
- return lightSource->setPointsAtY(lightElement->pointsAtY()->currentValue()->value());
- if (attrName == SVGNames::pointsAtZAttr)
- return lightSource->setPointsAtZ(lightElement->pointsAtZ()->currentValue()->value());
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName == SVGNames::zAttr)
+ return lightSource->setPosition(effect->filter()->resolve3dPoint(lightElement->position()));
+ if (attrName == SVGNames::pointsAtXAttr || attrName == SVGNames::pointsAtYAttr || attrName == SVGNames::pointsAtZAttr)
+ return lightSource->setPointsAt(effect->filter()->resolve3dPoint(lightElement->pointsAt()));
if (attrName == SVGNames::specularExponentAttr)
return lightSource->setSpecularExponent(lightElement->specularExponent()->currentValue()->value());
if (attrName == SVGNames::limitingConeAngleAttr)

Powered by Google App Engine
This is Rietveld 408576698