2D Canvas setTransform makes unnecessary matrix mults
authormdelaney@apple.com <mdelaney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 06:29:33 +0000 (06:29 +0000)
committermdelaney@apple.com <mdelaney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 06:29:33 +0000 (06:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79190

Reviewed by Dan Bernstein.

No new tests - plenty of current tests using setTransform.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setTransform):

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

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

index 120213d..6dff143 100644 (file)
@@ -1,3 +1,15 @@
+2012-02-21  Matthew Delaney  <mdelaney@apple.com>
+
+        2D Canvas setTransform makes unnecessary matrix mults
+        https://bugs.webkit.org/show_bug.cgi?id=79190
+
+        Reviewed by Dan Bernstein.
+
+        No new tests - plenty of current tests using setTransform.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setTransform):
+
 2012-02-21  MORITA Hajime <morrita@google.com>
 
         INPUT_SPEECH should be implemented as a PageSupplement.
index aa15577..55e2089 100644 (file)
@@ -669,9 +669,8 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo
     AffineTransform ctm = state().m_transform;
     if (!ctm.isInvertible())
         return;
-    c->concatCTM(c->getCTM().inverse());
-    c->concatCTM(canvas()->baseTransform());
-    state().m_transform = ctm.inverse() * state().m_transform;
+    c->setCTM(canvas()->baseTransform());
+    state().m_transform = AffineTransform();
     m_path.transform(ctm);
 
     state().m_invertibleCTM = true;