Bug 711063 - Part 1.5: Add operator to gfx::Matrix for size transformation. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Thu, 05 Jan 2012 08:17:51 +0100
changeset 85067 f8c79a52b765874e93c8e4614df85e8d23e7a8fd
parent 85066 33fa4f12c4bbaba9182debbb684383deb082257c
child 85068 6b01463490513a2269d7c8de379d9208b3f706af
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs711063
milestone12.0a1
Bug 711063 - Part 1.5: Add operator to gfx::Matrix for size transformation. r=jrmuizel
gfx/2d/Matrix.h
--- a/gfx/2d/Matrix.h
+++ b/gfx/2d/Matrix.h
@@ -68,16 +68,26 @@ public:
     Point retPoint;
 
     retPoint.x = aPoint.x * _11 + aPoint.y * _21 + _31;
     retPoint.y = aPoint.x * _12 + aPoint.y * _22 + _32;
 
     return retPoint;
   }
 
+  Size operator *(const Size &aSize) const
+  {
+    Size retSize;
+
+    retSize.width = aSize.width * _11 + aSize.height * _21;
+    retSize.height = aSize.width * _12 + aSize.height * _22;
+
+    return retSize;
+  }
+
   Rect TransformBounds(const Rect& rect) const;
 
   // Apply a scale to this matrix. This scale will be applied -before- the
   // existing transformation of the matrix.
   Matrix &Scale(Float aX, Float aY)
   {
     _11 *= aX;
     _12 *= aX;