SVGFilterPrimitiveStandardAttributes.h [plain text]
#ifndef SVGFilterPrimitiveStandardAttributes_h
#define SVGFilterPrimitiveStandardAttributes_h
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "RenderSVGResourceFilter.h"
#include "RenderSVGResourceFilterPrimitive.h"
#include "SVGAnimatedLength.h"
#include "SVGAnimatedString.h"
#include "SVGStyledElement.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class Filter;
class FilterEffect;
class SVGFilterBuilder;
class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
public:
void setStandardAttributes(FilterEffect*) const;
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) = 0;
virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
protected:
SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void svgAttributeChanged(const QualifiedName&);
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
inline void invalidate()
{
if (RenderObject* primitiveRenderer = renderer())
RenderSVGResource::markForLayoutAndParentResourceInvalidation(primitiveRenderer);
}
inline void primitiveAttributeChanged(const QualifiedName& attribute)
{
if (RenderObject* primitiveRenderer = renderer())
static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->primitiveAttributeChanged(attribute);
}
private:
virtual bool isFilterEffect() const { return true; }
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE { return false; }
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
DECLARE_ANIMATED_LENGTH(X, x)
DECLARE_ANIMATED_LENGTH(Y, y)
DECLARE_ANIMATED_LENGTH(Width, width)
DECLARE_ANIMATED_LENGTH(Height, height)
DECLARE_ANIMATED_STRING(Result, result)
END_DECLARE_ANIMATED_PROPERTIES
};
void invalidateFilterPrimitiveParent(SVGElement*);
}
#endif // ENABLE(SVG)
#endif