SVGPathTraversalStateBuilder.h [plain text]
#pragma once
#include "SVGPathConsumer.h"
namespace WebCore {
class FloatPoint;
class PathTraversalState;
class SVGPathTraversalStateBuilder final : public SVGPathConsumer {
public:
SVGPathTraversalStateBuilder(PathTraversalState&, float desiredLength = 0);
unsigned pathSegmentIndex() const { return m_segmentIndex; }
float totalLength() const;
FloatPoint currentPoint() const;
void incrementPathSegmentCount() final { ++m_segmentIndex; }
bool continueConsuming() final;
private:
void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) final;
void lineTo(const FloatPoint&, PathCoordinateMode) final;
void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) final;
void closePath() final;
private:
void lineToHorizontal(float, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
void lineToVertical(float, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
void arcTo(float, float, float, bool, bool, const FloatPoint&, PathCoordinateMode) final { ASSERT_NOT_REACHED(); }
PathTraversalState& m_traversalState;
unsigned m_segmentIndex { 0 };
};
}