Title: [102157] trunk/Source/WebCore
Revision
102157
Author
[email protected]
Date
2011-12-06 11:27:31 -0800 (Tue, 06 Dec 2011)

Log Message

optimize TransformationMatrix::scale by not calling through to generic multiply
https://bugs.webkit.org/show_bug.cgi?id=73830

Reviewed by Kenneth Russell.

No new tests. Optimization only, existing tests exercise the code

* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::scaleNonUniform):
(WebCore::TransformationMatrix::scale3d):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102156 => 102157)


--- trunk/Source/WebCore/ChangeLog	2011-12-06 19:26:33 UTC (rev 102156)
+++ trunk/Source/WebCore/ChangeLog	2011-12-06 19:27:31 UTC (rev 102157)
@@ -1,3 +1,16 @@
+2011-12-06  Mike Reed  <[email protected]>
+
+        optimize TransformationMatrix::scale by not calling through to generic multiply
+        https://bugs.webkit.org/show_bug.cgi?id=73830
+
+        Reviewed by Kenneth Russell.
+
+        No new tests. Optimization only, existing tests exercise the code
+
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::scaleNonUniform):
+        (WebCore::TransformationMatrix::scale3d):
+
 2011-12-06  Eric Carlson  <[email protected]>
 
         Revert WebCore track Settings changes made in r101977

Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (102156 => 102157)


--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp	2011-12-06 19:26:33 UTC (rev 102156)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp	2011-12-06 19:27:31 UTC (rev 102157)
@@ -670,22 +670,26 @@
 
 TransformationMatrix& TransformationMatrix::scaleNonUniform(double sx, double sy)
 {
-    TransformationMatrix mat;
-    mat.m_matrix[0][0] = sx;
-    mat.m_matrix[1][1] = sy;
-
-    multiply(mat);
+    m_matrix[0][0] *= sx;
+    m_matrix[0][1] *= sx;
+    m_matrix[0][2] *= sx;
+    m_matrix[0][3] *= sx;
+    
+    m_matrix[1][0] *= sy;
+    m_matrix[1][1] *= sy;
+    m_matrix[1][2] *= sy;
+    m_matrix[1][3] *= sy;
     return *this;
 }
 
 TransformationMatrix& TransformationMatrix::scale3d(double sx, double sy, double sz)
 {
-    TransformationMatrix mat;
-    mat.m_matrix[0][0] = sx;
-    mat.m_matrix[1][1] = sy;
-    mat.m_matrix[2][2] = sz;
-
-    multiply(mat);
+    scaleNonUniform(sx, sy);
+    
+    m_matrix[2][0] *= sz;
+    m_matrix[2][1] *= sz;
+    m_matrix[2][2] *= sz;
+    m_matrix[2][3] *= sz;
     return *this;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to