#ifndef RenderSVGResourceMarker_h
#define RenderSVGResourceMarker_h
#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "core/svg/SVGElement.h"
#include "core/svg/SVGMarkerElement.h"
#include "platform/geometry/FloatRect.h"
#include "wtf/HashSet.h"
namespace WebCore {
class AffineTransform;
class RenderObject;
class RenderSVGResourceMarker FINAL : public RenderSVGResourceContainer {
public:
explicit RenderSVGResourceMarker(SVGMarkerElement*);
virtual ~RenderSVGResourceMarker();
virtual const char* renderName() const OVERRIDE { return "RenderSVGResourceMarker"; }
virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE;
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
void draw(PaintInfo&, const AffineTransform&);
FloatRect markerBoundaries(const AffineTransform& markerTransformation) const;
virtual void applyViewportClip(PaintInfo&) OVERRIDE;
virtual void layout() OVERRIDE;
virtual void calcViewport() OVERRIDE;
virtual const AffineTransform& localToParentTransform() const OVERRIDE;
AffineTransform markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short) OVERRIDE { return false; }
FloatPoint referencePoint() const;
float angle() const;
SVGMarkerUnitsType markerUnits() const { return toSVGMarkerElement(element())->markerUnits()->currentValue()->enumValue(); }
virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; }
static const RenderSVGResourceType s_resourceType;
private:
AffineTransform markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth = -1) const;
AffineTransform viewportTransform() const;
mutable AffineTransform m_localToParentTransform;
FloatRect m_viewport;
};
DEFINE_RENDER_SVG_RESOURCE_TYPE_CASTS(RenderSVGResourceMarker, MarkerResourceType);
}
#endif