Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: webkit/compositor_bindings/web_transformation_matrix_util.cc

Issue 12035029: Finish migrating cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/compositor_bindings/web_transformation_matrix_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/compositor_bindings/web_transformation_matrix_util.cc
diff --git a/webkit/compositor_bindings/web_transformation_matrix_util.cc b/webkit/compositor_bindings/web_transformation_matrix_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d7c621154d7dba0fc46a3ca1926b4b9c1bd3de82
--- /dev/null
+++ b/webkit/compositor_bindings/web_transformation_matrix_util.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/compositor_bindings/web_transformation_matrix_util.h"
+
+using WebKit::WebTransformationMatrix;
+
+namespace webkit {
+
+gfx::Transform WebTransformationMatrixUtil::ToTransform(
+ const WebTransformationMatrix& matrix) {
+ return gfx::Transform(matrix.m11(), matrix.m21(), matrix.m31(), matrix.m41(),
+ matrix.m12(), matrix.m22(), matrix.m32(), matrix.m42(),
+ matrix.m13(), matrix.m23(), matrix.m33(), matrix.m43(),
+ matrix.m14(), matrix.m24(), matrix.m34(), matrix.m44());
+}
+
+WebTransformationMatrix WebTransformationMatrixUtil::ToWebTransformationMatrix(
+ const gfx::Transform& transform) {
+ return WebTransformationMatrix(transform.matrix().getDouble(0, 0),
+ transform.matrix().getDouble(1, 0),
+ transform.matrix().getDouble(2, 0),
+ transform.matrix().getDouble(3, 0),
+ transform.matrix().getDouble(0, 1),
+ transform.matrix().getDouble(1, 1),
+ transform.matrix().getDouble(2, 1),
+ transform.matrix().getDouble(3, 1),
+ transform.matrix().getDouble(0, 2),
+ transform.matrix().getDouble(1, 2),
+ transform.matrix().getDouble(2, 2),
+ transform.matrix().getDouble(3, 2),
+ transform.matrix().getDouble(0, 3),
+ transform.matrix().getDouble(1, 3),
+ transform.matrix().getDouble(2, 3),
+ transform.matrix().getDouble(3, 3));
+
+}
+
+} // namespace webkit
« no previous file with comments | « webkit/compositor_bindings/web_transformation_matrix_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698