SVGFESpotLightElement.cpp [plain text]
#include "config.h"
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFESpotLightElement.h"
#include "SVGNames.h"
#include "SpotLightSource.h"
namespace WebCore {
inline SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* document)
: SVGFELightElement(tagName, document)
{
ASSERT(hasTagName(SVGNames::feSpotLightTag));
}
PassRefPtr<SVGFESpotLightElement> SVGFESpotLightElement::create(const QualifiedName& tagName, Document* document)
{
return adoptRef(new SVGFESpotLightElement(tagName, document));
}
PassRefPtr<LightSource> SVGFESpotLightElement::lightSource() const
{
FloatPoint3D pos(x(), y(), z());
FloatPoint3D direction(pointsAtX(), pointsAtY(), pointsAtZ());
return SpotLightSource::create(pos, direction, specularExponent(), limitingConeAngle());
}
}
#endif // ENABLE(SVG)