#ifndef SVGPathBlender_h
#define SVGPathBlender_h
#include "core/svg/SVGPathConsumer.h"
namespace WebCore {
enum FloatBlendMode {
BlendHorizontal,
BlendVertical
};
class SVGPathSource;
class SVGPathBlender {
WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED;
public:
SVGPathBlender();
bool addAnimatedPath(SVGPathSource*, SVGPathSource*, SVGPathConsumer*, unsigned repeatCount);
bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsumer*);
void cleanup();
private:
bool blendMoveToSegment();
bool blendLineToSegment();
bool blendLineToHorizontalSegment();
bool blendLineToVerticalSegment();
bool blendCurveToCubicSegment();
bool blendCurveToCubicSmoothSegment();
bool blendCurveToQuadraticSegment();
bool blendCurveToQuadraticSmoothSegment();
bool blendArcToSegment();
float blendAnimatedDimensonalFloat(float, float, FloatBlendMode);
FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint& to);
SVGPathSource* m_fromSource;
SVGPathSource* m_toSource;
SVGPathConsumer* m_consumer;
FloatPoint m_fromCurrentPoint;
FloatPoint m_toCurrentPoint;
PathCoordinateMode m_fromMode;
PathCoordinateMode m_toMode;
float m_progress;
unsigned m_addTypesCount;
bool m_isInFirstHalfOfAnimation;
};
}
#endif