SkewTransformOperation.h [plain text]
#pragma once
#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));
}
Ref<TransformOperation> clone() const override
{
return adoptRef(*new SkewTransformOperation(m_angleX, m_angleY, type()));
}
double angleX() const { return m_angleX; }
double angleY() const { return m_angleY; }
private:
bool isIdentity() const override { return m_angleX == 0 && m_angleY == 0; }
bool isAffectedByTransformOrigin() const override { return !isIdentity(); }
bool operator==(const TransformOperation&) const override;
bool apply(TransformationMatrix& transform, const FloatSize&) const override
{
transform.skew(m_angleX, m_angleY);
return false;
}
Ref<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) override;
void dump(WTF::TextStream&) const final;
SkewTransformOperation(double angleX, double angleY, OperationType type)
: TransformOperation(type)
, m_angleX(angleX)
, m_angleY(angleY)
{
ASSERT(isSkewTransformOperationType());
}
double m_angleX;
double m_angleY;
};
}
SPECIALIZE_TYPE_TRAITS_TRANSFORMOPERATION(WebCore::SkewTransformOperation, isSkewTransformOperationType())