#ifndef TransformOperation_h
#define TransformOperation_h
#include "platform/geometry/FloatSize.h"
#include "platform/transforms/TransformationMatrix.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
class PLATFORM_EXPORT TransformOperation : public RefCounted<TransformOperation> {
public:
enum OperationType {
ScaleX, ScaleY, Scale,
TranslateX, TranslateY, Translate,
Rotate,
RotateZ = Rotate,
SkewX, SkewY, Skew,
Matrix,
ScaleZ, Scale3D,
TranslateZ, Translate3D,
RotateX, RotateY, Rotate3D,
Matrix3D,
Perspective,
Interpolated,
Identity, None
};
virtual ~TransformOperation() { }
virtual bool operator==(const TransformOperation&) const = 0;
bool operator!=(const TransformOperation& o) const { return !(*this == o); }
virtual bool isIdentity() const = 0;
virtual void apply(TransformationMatrix&, const FloatSize& borderBoxSize) const = 0;
virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) = 0;
virtual OperationType type() const = 0;
bool isSameType(const TransformOperation& other) const { return other.type() == type(); }
bool is3DOperation() const
{
OperationType opType = type();
return opType == ScaleZ
|| opType == Scale3D
|| opType == TranslateZ
|| opType == Translate3D
|| opType == RotateX
|| opType == RotateY
|| opType == Rotate3D
|| opType == Matrix3D
|| opType == Perspective
|| opType == Interpolated;
}
virtual bool dependsOnBoxSize() const { return false; }
};
}
#endif