SkewTransformOperation.h [plain text]
#ifndef SkewTransformOperation_h
#define SkewTransformOperation_h
#include "TransformOperation.h"
#include <wtf/Ref.h>
namespace WebCore {
class SkewTransformOperation final : public TransformOperation {
public:
static Ref<SkewTransformOperation> create(double angleX, double angleY, OperationType type)
{
return adoptRef(*new SkewTransformOperation(angleX, angleY, type));
}
virtual Ref<TransformOperation> clone() const override
{
return adoptRef(*new SkewTransformOperation(m_angleX, m_angleY, m_type));
}
double angleX() const { return m_angleX; }
double angleY() const { return m_angleY; }
private:
virtual bool isIdentity() const override { return m_angleX == 0 && m_angleY == 0; }
virtual bool isAffectedByTransformOrigin() const override { return !isIdentity(); }
virtual OperationType type() const override { return m_type; }
virtual bool isSameType(const TransformOperation& o) const override { return o.type() == m_type; }
virtual bool operator==(const TransformOperation&) const override;
virtual bool apply(TransformationMatrix& transform, const FloatSize&) const override
{
transform.skew(m_angleX, m_angleY);
return false;
}
virtual Ref<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)
{
ASSERT(isSkewTransformOperationType());
}
double m_angleX;
double m_angleY;
OperationType m_type;
};
}
SPECIALIZE_TYPE_TRAITS_TRANSFORMOPERATION(WebCore::SkewTransformOperation, isSkewTransformOperationType())
#endif // SkewTransformOperation_h