Switch transform operations to FloatSize
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jul 2011 23:18:34 +0000 (23:18 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jul 2011 23:18:34 +0000 (23:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64301

Reviewed by Simon Fraser.

Changing TransformOperation and its progeny to operate on FloatSizes instead of IntSizes.

* platform/graphics/transforms/IdentityTransformOperation.h:
(WebCore::IdentityTransformOperation::apply):
* platform/graphics/transforms/Matrix3DTransformOperation.cpp:
(WebCore::Matrix3DTransformOperation::blend):
* platform/graphics/transforms/Matrix3DTransformOperation.h:
(WebCore::Matrix3DTransformOperation::apply):
* platform/graphics/transforms/MatrixTransformOperation.cpp:
(WebCore::MatrixTransformOperation::blend):
* platform/graphics/transforms/MatrixTransformOperation.h:
(WebCore::MatrixTransformOperation::apply):
* platform/graphics/transforms/PerspectiveTransformOperation.h:
(WebCore::PerspectiveTransformOperation::apply):
* platform/graphics/transforms/RotateTransformOperation.h:
(WebCore::RotateTransformOperation::apply):
* platform/graphics/transforms/ScaleTransformOperation.h:
(WebCore::ScaleTransformOperation::apply):
* platform/graphics/transforms/SkewTransformOperation.h:
(WebCore::SkewTransformOperation::apply):
* platform/graphics/transforms/TransformOperation.h:
* platform/graphics/transforms/TransformOperations.h:
(WebCore::TransformOperations::apply):
* platform/graphics/transforms/TranslateTransformOperation.h:
(WebCore::TranslateTransformOperation::x):
(WebCore::TranslateTransformOperation::y):
(WebCore::TranslateTransformOperation::z):
(WebCore::TranslateTransformOperation::apply):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91880 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/transforms/IdentityTransformOperation.h
Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp
Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h
Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp
Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h
Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h
Source/WebCore/platform/graphics/transforms/RotateTransformOperation.h
Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.h
Source/WebCore/platform/graphics/transforms/SkewTransformOperation.h
Source/WebCore/platform/graphics/transforms/TransformOperation.h
Source/WebCore/platform/graphics/transforms/TransformOperations.h
Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h

index 89c8a7f..71d3cfc 100644 (file)
@@ -1,5 +1,41 @@
 2011-07-27  Levi Weintraub  <leviw@chromium.org>
 
+        Switch transform operations to FloatSize
+        https://bugs.webkit.org/show_bug.cgi?id=64301
+
+        Reviewed by Simon Fraser.
+
+        Changing TransformOperation and its progeny to operate on FloatSizes instead of IntSizes.
+
+        * platform/graphics/transforms/IdentityTransformOperation.h:
+        (WebCore::IdentityTransformOperation::apply):
+        * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
+        (WebCore::Matrix3DTransformOperation::blend):
+        * platform/graphics/transforms/Matrix3DTransformOperation.h:
+        (WebCore::Matrix3DTransformOperation::apply):
+        * platform/graphics/transforms/MatrixTransformOperation.cpp:
+        (WebCore::MatrixTransformOperation::blend):
+        * platform/graphics/transforms/MatrixTransformOperation.h:
+        (WebCore::MatrixTransformOperation::apply):
+        * platform/graphics/transforms/PerspectiveTransformOperation.h:
+        (WebCore::PerspectiveTransformOperation::apply):
+        * platform/graphics/transforms/RotateTransformOperation.h:
+        (WebCore::RotateTransformOperation::apply):
+        * platform/graphics/transforms/ScaleTransformOperation.h:
+        (WebCore::ScaleTransformOperation::apply):
+        * platform/graphics/transforms/SkewTransformOperation.h:
+        (WebCore::SkewTransformOperation::apply):
+        * platform/graphics/transforms/TransformOperation.h:
+        * platform/graphics/transforms/TransformOperations.h:
+        (WebCore::TransformOperations::apply):
+        * platform/graphics/transforms/TranslateTransformOperation.h:
+        (WebCore::TranslateTransformOperation::x):
+        (WebCore::TranslateTransformOperation::y):
+        (WebCore::TranslateTransformOperation::z):
+        (WebCore::TranslateTransformOperation::apply):
+
+2011-07-27  Levi Weintraub  <leviw@chromium.org>
+
         unicode-bidi:-webkit-plaintext does not work on <textarea>
         https://bugs.webkit.org/show_bug.cgi?id=65074
 
index 347737c..e3eccc1 100644 (file)
@@ -46,7 +46,7 @@ private:
         return isSameType(o);
     }
 
-    virtual bool apply(TransformationMatrix&, const IntSize&) const
+    virtual bool apply(TransformationMatrix&, const FloatSize&) const
     {
         return false;
     }
index 230be3c..e366213 100644 (file)
@@ -38,7 +38,7 @@ PassRefPtr<TransformOperation> Matrix3DTransformOperation::blend(const Transform
         return this;
 
     // Convert the TransformOperations into matrices
-    IntSize size;
+    FloatSize size;
     TransformationMatrix fromT;
     TransformationMatrix toT;
     if (from)
index dd5dae2..b0577a6 100644 (file)
@@ -53,7 +53,7 @@ private:
         return m_matrix == m->m_matrix;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize&) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize&) const
     {
         transform.multiply(TransformationMatrix(m_matrix));
         return false;
index 0eaccea..05efee0 100644 (file)
@@ -34,7 +34,7 @@ PassRefPtr<TransformOperation> MatrixTransformOperation::blend(const TransformOp
         return this;
 
     // convert the TransformOperations into matrices
-    IntSize size;
+    FloatSize size;
     TransformationMatrix fromT;
     TransformationMatrix toT(m_a, m_b, m_c, m_d, m_e, m_f);
     if (from) {
index 6f4e725..45f9ea7 100644 (file)
@@ -59,7 +59,7 @@ private:
         return m_a == m->m_a && m_b == m->m_b && m_c == m->m_c && m_d == m->m_d && m_e == m->m_e && m_f == m->m_f;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize&) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize&) const
     {
         TransformationMatrix matrix(m_a, m_b, m_c, m_d, m_e, m_f);
         transform.multiply(matrix);
index 886d3dc..52452b3 100644 (file)
@@ -53,7 +53,7 @@ private:
         return m_p == p->m_p;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize&) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize&) const
     {
         transform.applyPerspective(m_p.calcFloatValue(1));
         return false;
index 2acb002..0d495c5 100644 (file)
@@ -60,7 +60,7 @@ private:
         return m_x == r->m_x && m_y == r->m_y && m_z == r->m_z && m_angle == r->m_angle;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize& /*borderBoxSize*/) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize& /*borderBoxSize*/) const
     {
         transform.rotate3d(m_x, m_y, m_z, m_angle);
         return false;
index a87bb3b..7343d09 100644 (file)
@@ -59,7 +59,7 @@ private:
         return m_x == s->m_x && m_y == s->m_y && m_z == s->m_z;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize&) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize&) const
     {
         transform.scale3d(m_x, m_y, m_z);
         return false;
index afe9a7b..ddde986 100644 (file)
@@ -52,7 +52,7 @@ private:
         return m_angleX == s->m_angleX && m_angleY == s->m_angleY;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize&) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize&) const
     {
         transform.skew(m_angleX, m_angleY);
         return false;
index c610c4b..1e7ebb0 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef TransformOperation_h
 #define TransformOperation_h
 
+#include "FloatSize.h"
 #include "TransformationMatrix.h"
-#include "IntSize.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
@@ -59,7 +59,7 @@ public:
     virtual bool isIdentity() const = 0;
 
     // Return true if the borderBoxSize was used in the computation, false otherwise.
-    virtual bool apply(TransformationMatrix&, const IntSize& borderBoxSize) const = 0;
+    virtual bool apply(TransformationMatrix&, const FloatSize& borderBoxSize) const = 0;
 
     virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) = 0;
 
index 981e1f6..fbce22f 100644 (file)
@@ -42,7 +42,7 @@ public:
         return !(*this == o);
     }
     
-    void apply(const IntSize& sz, TransformationMatrix& t) const
+    void apply(const FloatSize& sz, TransformationMatrix& t) const
     {
         for (unsigned i = 0; i < m_operations.size(); ++i)
             m_operations[i]->apply(t, sz);
index ea48d49..b194d83 100644 (file)
@@ -42,9 +42,9 @@ public:
         return adoptRef(new TranslateTransformOperation(tx, ty, tz, 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()); }
-    double z(const IntSize&) const { return m_z.calcFloatValue(1); }
+    double x(const FloatSize& borderBoxSize) const { return m_x.calcFloatValue(borderBoxSize.width()); }
+    double y(const FloatSize& borderBoxSize) const { return m_y.calcFloatValue(borderBoxSize.height()); }
+    double z(const FloatSize&) const { return m_z.calcFloatValue(1); }
 
     Length x() const { return m_x; }
     Length y() const { return m_y; }
@@ -64,7 +64,7 @@ private:
         return m_x == t->m_x && m_y == t->m_y && m_z == t->m_z;
     }
 
-    virtual bool apply(TransformationMatrix& transform, const IntSize& borderBoxSize) const
+    virtual bool apply(TransformationMatrix& transform, const FloatSize& borderBoxSize) const
     {
         transform.translate3d(x(borderBoxSize), y(borderBoxSize), z(borderBoxSize));
         return m_x.type() == Percent || m_y.type() == Percent;