diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/transforms')
5 files changed, 15 insertions, 16 deletions
diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp index f275526..3f88140 100644 --- a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp +++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp @@ -164,12 +164,10 @@ AffineTransform AffineTransform::inverse() const return result; } -AffineTransform& AffineTransform::multiply(const AffineTransform& other) -{ - return (*this) *= other; -} -AffineTransform& AffineTransform::multLeft(const AffineTransform& other) +// Multiplies this AffineTransform by the provided AffineTransform - i.e. +// this = this * other; +AffineTransform& AffineTransform::multiply(const AffineTransform& other) { AffineTransform trans; @@ -192,7 +190,7 @@ AffineTransform& AffineTransform::rotate(double a) double sinAngle = sin(a); AffineTransform rot(cosAngle, sinAngle, -sinAngle, cosAngle, 0, 0); - multLeft(rot); + multiply(rot); return *this; } diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.h b/Source/WebCore/platform/graphics/transforms/AffineTransform.h index baee102..50d0655 100644 --- a/Source/WebCore/platform/graphics/transforms/AffineTransform.h +++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.h @@ -55,7 +55,8 @@ class IntPoint; class IntRect; class TransformationMatrix; -class AffineTransform : public FastAllocBase { +class AffineTransform { + WTF_MAKE_FAST_ALLOCATED; public: typedef double Transform[6]; @@ -95,8 +96,7 @@ public: void makeIdentity(); - AffineTransform& multiply(const AffineTransform&); - AffineTransform& multLeft(const AffineTransform&); + AffineTransform& multiply(const AffineTransform& other); AffineTransform& scale(double); AffineTransform& scale(double sx, double sy); AffineTransform& scaleNonUniform(double sx, double sy); @@ -147,15 +147,14 @@ public: // *this = *this * t (i.e., a multRight) AffineTransform& operator*=(const AffineTransform& t) { - *this = *this * t; - return *this; + return multiply(t); } // result = *this * t (i.e., a multRight) AffineTransform operator*(const AffineTransform& t) const { - AffineTransform result = t; - result.multLeft(*this); + AffineTransform result = *this; + result *= t; return result; } diff --git a/Source/WebCore/platform/graphics/transforms/TransformOperations.h b/Source/WebCore/platform/graphics/transforms/TransformOperations.h index c0da377..981e1f6 100644 --- a/Source/WebCore/platform/graphics/transforms/TransformOperations.h +++ b/Source/WebCore/platform/graphics/transforms/TransformOperations.h @@ -31,7 +31,8 @@ namespace WebCore { -class TransformOperations : public FastAllocBase { +class TransformOperations { + WTF_MAKE_FAST_ALLOCATED; public: TransformOperations(bool makeIdentity = false); diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp index 10c7f70..357a140 100644 --- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp +++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp @@ -27,6 +27,7 @@ #include "config.h" #include "TransformationMatrix.h" +#include "AffineTransform.h" #include "FloatPoint3D.h" #include "FloatRect.h" #include "FloatQuad.h" diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h index f13bcc1..c883675 100644 --- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h +++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h @@ -26,7 +26,6 @@ #ifndef TransformationMatrix_h #define TransformationMatrix_h -#include "AffineTransform.h" #include "FloatPoint.h" #include "IntPoint.h" #include <string.h> //for memcpy @@ -65,7 +64,8 @@ class FloatPoint3D; class FloatRect; class FloatQuad; -class TransformationMatrix : public FastAllocBase { +class TransformationMatrix { + WTF_MAKE_FAST_ALLOCATED; public: typedef double Matrix4[4][4]; |