Title: [135031] trunk/Source/Platform
Revision
135031
Author
dan...@chromium.org
Date
2012-11-16 20:19:27 -0800 (Fri, 16 Nov 2012)

Log Message

[chromium] Add conversion between WebTransformation and gfx::Transform
https://bugs.webkit.org/show_bug.cgi?id=102575

Reviewed by James Robinson.

* chromium/public/WebTransformationMatrix.h:
(WebTransformationMatrix):
(WebKit::WebTransformationMatrix::WebTransformationMatrix):
(WebKit::WebTransformationMatrix::operator=):
(WebKit::WebTransformationMatrix::operator gfx::Transform):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (135030 => 135031)


--- trunk/Source/Platform/ChangeLog	2012-11-17 02:52:42 UTC (rev 135030)
+++ trunk/Source/Platform/ChangeLog	2012-11-17 04:19:27 UTC (rev 135031)
@@ -1,3 +1,16 @@
+2012-11-16  Dana Jansens  <dan...@chromium.org>
+
+        [chromium] Add conversion between WebTransformation and gfx::Transform
+        https://bugs.webkit.org/show_bug.cgi?id=102575
+
+        Reviewed by James Robinson.
+
+        * chromium/public/WebTransformationMatrix.h:
+        (WebTransformationMatrix):
+        (WebKit::WebTransformationMatrix::WebTransformationMatrix):
+        (WebKit::WebTransformationMatrix::operator=):
+        (WebKit::WebTransformationMatrix::operator gfx::Transform):
+
 2012-11-16  Tommy Widenflycht  <tom...@google.com>
 
         MediaStream API: Update RTCPeerConnection states to match the latest editors draft

Modified: trunk/Source/Platform/chromium/public/WebTransformationMatrix.h (135030 => 135031)


--- trunk/Source/Platform/chromium/public/WebTransformationMatrix.h	2012-11-17 02:52:42 UTC (rev 135030)
+++ trunk/Source/Platform/chromium/public/WebTransformationMatrix.h	2012-11-17 04:19:27 UTC (rev 135031)
@@ -36,6 +36,8 @@
 #include "FloatPoint3D.h"
 #include "FloatQuad.h"
 #include "TransformationMatrix.h"
+#else
+#include <ui/gfx/transform.h>
 #endif
 
 #include "WebCommon.h"
@@ -137,6 +139,32 @@
     // Conversions between WebKit::WebTransformationMatrix and WebCore::TransformationMatrix
     explicit WebTransformationMatrix(const WebCore::TransformationMatrix&);
     WebCore::TransformationMatrix toWebCoreTransform() const;
+#else
+    // FIXME: Make this implicit once compositor is not using this class internally.
+    explicit WebTransformationMatrix(const gfx::Transform& transform)
+    {
+        for (int i = 0; i < 4; ++i)
+            for (int j = 0; j < 4; ++j)
+                m_matrix[i][j] = transform.matrix().getDouble(j, i);
+    }
+
+    WebTransformationMatrix& operator=(const gfx::Transform& transform)
+    {
+        for (int i = 0; i < 4; ++i)
+            for (int j = 0; j < 4; ++j)
+                m_matrix[i][j] = transform.matrix().getDouble(j, i);
+        return *this;
+    }
+
+    // FIXME: Make this an operator once compositor is not using this class internally.
+    gfx::Transform toTransform() const
+    {
+        gfx::Transform transform;
+        for (int i = 0; i < 4; ++i)
+            for (int j = 0; j < 4; ++j)
+                transform.matrix().setDouble(i, j, m_matrix[j][i]);
+        return transform;
+    }
 #endif
 
 protected:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to