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

Unified Diff: Source/core/svg/SVGFESpecularLightingElement.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
« no previous file with comments | « Source/core/svg/SVGFEPointLightElement.cpp ('k') | Source/core/svg/SVGFESpotLightElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFESpecularLightingElement.cpp
diff --git a/Source/core/svg/SVGFESpecularLightingElement.cpp b/Source/core/svg/SVGFESpecularLightingElement.cpp
index 41bd56f07050e8548ae1cfce376ff4dd231d402d..18501eebbdf7360158f16f5b655b0b9c1e0f0142 100644
--- a/Source/core/svg/SVGFESpecularLightingElement.cpp
+++ b/Source/core/svg/SVGFESpecularLightingElement.cpp
@@ -108,23 +108,16 @@ bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
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)
« no previous file with comments | « Source/core/svg/SVGFEPointLightElement.cpp ('k') | Source/core/svg/SVGFESpotLightElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698