Commit c221a8e3 authored by simon.fraser@apple.com's avatar simon.fraser@apple.com
Browse files

2009-02-05 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Anders Carlsson

        Add some methods to the TransformOperation classes that are required
        by GraphicsLayer when ACCELERATED_COMPOSITING is turned on.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 22c1b3ec
2009-02-05 Simon Fraser <simon.fraser@apple.com>
Reviewed by Anders Carlsson
Add some methods to the TransformOperation classes that are required
by GraphicsLayer when ACCELERATED_COMPOSITING is turned on.
* platform/graphics/transforms/MatrixTransformOperation.h:
(WebCore::MatrixTransformOperation::create):
(WebCore::MatrixTransformOperation::MatrixTransformOperation):
* platform/graphics/transforms/ScaleTransformOperation.h:
(WebCore::ScaleTransformOperation::x):
(WebCore::ScaleTransformOperation::y):
* platform/graphics/transforms/TranslateTransformOperation.h:
(WebCore::TranslateTransformOperation::x):
(WebCore::TranslateTransformOperation::y):
2009-02-05 Simon Fraser <simon.fraser@apple.com>
 
Minor clenaup: fix brace style in CompositeAnimationPrivate::updateTransitions(),
......@@ -26,6 +26,7 @@
#define MatrixTransformOperation_h
#include "TransformOperation.h"
#include "TransformationMatrix.h"
namespace WebCore {
......@@ -36,6 +37,11 @@ public:
return adoptRef(new MatrixTransformOperation(a, b, c, d, e, f));
}
static PassRefPtr<MatrixTransformOperation> create(const TransformationMatrix& t)
{
return adoptRef(new MatrixTransformOperation(t));
}
private:
virtual bool isIdentity() const { return m_a == 1 && m_b == 0 && m_c == 0 && m_d == 1 && m_e == 0 && m_f == 0; }
virtual OperationType getOperationType() const { return MATRIX; }
......@@ -68,6 +74,16 @@ private:
, m_f(f)
{
}
MatrixTransformOperation(const TransformationMatrix& t)
: m_a(t.a())
, m_b(t.b())
, m_c(t.c())
, m_d(t.d())
, m_e(t.e())
, m_f(t.f())
{
}
double m_a;
double m_b;
......
......@@ -36,6 +36,9 @@ public:
return adoptRef(new ScaleTransformOperation(sx, sy, type));
}
double x() const { return m_x; }
double y() const { return m_y; }
private:
virtual bool isIdentity() const { return m_x == 1 && m_y == 1; }
virtual OperationType getOperationType() const { return m_type; }
......
......@@ -37,6 +37,10 @@ public:
return adoptRef(new TranslateTransformOperation(tx, ty, type));
}
double x(const IntSize& borderBoxSize) const { return m_x.calcFloatValue(borderBoxSize.width()); }
double y(const IntSize& borderBoxSize) const { return m_y.calcFloatValue(borderBoxSize.height()); }
private:
virtual bool isIdentity() const { return m_x.calcFloatValue(1) == 0 && m_y.calcFloatValue(1) == 0; }
virtual OperationType getOperationType() const { return m_type; }
virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == m_type; }
......@@ -57,7 +61,6 @@ public:
virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false);
private:
TranslateTransformOperation(const Length& tx, const Length& ty, OperationType type)
: m_x(tx)
, m_y(ty)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment