#ifndef SkewTransformOperation_h
#define SkewTransformOperation_h
#include "platform/transforms/TransformOperation.h"
namespace WebCore {
class PLATFORM_EXPORT SkewTransformOperation : public TransformOperation {
public:
static PassRefPtr<SkewTransformOperation> create(double angleX, double angleY, OperationType type)
{
return adoptRef(new SkewTransformOperation(angleX, angleY, type));
}
double angleX() const { return m_angleX; }
double angleY() const { return m_angleY; }
private:
virtual bool isIdentity() const OVERRIDE { return !m_angleX && !m_angleY; }
virtual OperationType type() const OVERRIDE { return m_type; }
virtual bool operator==(const TransformOperation& o) const OVERRIDE
{
if (!isSameType(o))
return false;
const SkewTransformOperation* s = static_cast<const SkewTransformOperation*>(&o);
return m_angleX == s->m_angleX && m_angleY == s->m_angleY;
}
virtual void apply(TransformationMatrix& transform, const FloatSize&) const OVERRIDE
{
transform.skew(m_angleX, m_angleY);
}
virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) OVERRIDE;
SkewTransformOperation(double angleX, double angleY, OperationType type)
: m_angleX(angleX)
, m_angleY(angleY)
, m_type(type)
{
}
double m_angleX;
double m_angleY;
OperationType m_type;
};
}
#endif