TransformOperations.h [plain text]
#ifndef TransformOperations_h
#define TransformOperations_h
#include "LayoutSize.h"
#include "TransformOperation.h"
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class TransformOperations {
WTF_MAKE_FAST_ALLOCATED;
public:
TransformOperations(bool makeIdentity = false);
bool operator==(const TransformOperations& o) const;
bool operator!=(const TransformOperations& o) const
{
return !(*this == o);
}
void apply(const FloatSize& sz, TransformationMatrix& t) const
{
for (unsigned i = 0; i < m_operations.size(); ++i)
m_operations[i]->apply(t, sz);
}
bool has3DOperation() const
{
for (unsigned i = 0; i < m_operations.size(); ++i)
if (m_operations[i]->is3DOperation())
return true;
return false;
}
bool operationsMatch(const TransformOperations&) const;
void clear()
{
m_operations.clear();
}
bool affectedByTransformOrigin() const;
Vector<RefPtr<TransformOperation>>& operations() { return m_operations; }
const Vector<RefPtr<TransformOperation>>& operations() const { return m_operations; }
size_t size() const { return m_operations.size(); }
const TransformOperation* at(size_t index) const { return index < m_operations.size() ? m_operations.at(index).get() : 0; }
TransformOperations blendByMatchingOperations(const TransformOperations& from, const double& progress) const;
TransformOperations blendByUsingMatrixInterpolation(const TransformOperations& from, double progress, const LayoutSize&) const;
TransformOperations blend(const TransformOperations& from, double progress, const LayoutSize&) const;
private:
Vector<RefPtr<TransformOperation>> m_operations;
};
TextStream& operator<<(TextStream&, const TransformOperations&);
}
#endif // TransformOperations_h