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

Unified Diff: webkit/compositor_bindings/web_layer_impl.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
Index: webkit/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/compositor_bindings/web_layer_impl.cc b/webkit/compositor_bindings/web_layer_impl.cc
index 3e44860fb24cd14ceb308f1b4b93db30dd7ff35f..db04332db11e61bc637e9972f4fa01f9643e3528 100644
--- a/webkit/compositor_bindings/web_layer_impl.cc
+++ b/webkit/compositor_bindings/web_layer_impl.cc
@@ -14,36 +14,11 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMatrix.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
#include "webkit/compositor_bindings/web_animation_impl.h"
+#include "webkit/compositor_bindings/web_transformation_matrix_util.h"
using cc::Animation;
using cc::Layer;
-
-namespace {
-gfx::Transform convertWebTransformationMatrixToTransform(const WebKit::WebTransformationMatrix& matrix)
-{
- // TODO(jamesr): When gfx::Transform provides a constructor that does not
- // initialize the matrix, use that.
- gfx::Transform transform;
- transform.matrix().setDouble(0, 0, matrix.m11());
- transform.matrix().setDouble(0, 1, matrix.m21());
- transform.matrix().setDouble(0, 2, matrix.m31());
- transform.matrix().setDouble(0, 3, matrix.m41());
- transform.matrix().setDouble(1, 0, matrix.m12());
- transform.matrix().setDouble(1, 1, matrix.m22());
- transform.matrix().setDouble(1, 2, matrix.m32());
- transform.matrix().setDouble(1, 3, matrix.m42());
- transform.matrix().setDouble(2, 0, matrix.m13());
- transform.matrix().setDouble(2, 1, matrix.m23());
- transform.matrix().setDouble(2, 2, matrix.m33());
- transform.matrix().setDouble(2, 3, matrix.m43());
- transform.matrix().setDouble(3, 0, matrix.m14());
- transform.matrix().setDouble(3, 1, matrix.m24());
- transform.matrix().setDouble(3, 2, matrix.m34());
- transform.matrix().setDouble(3, 3, matrix.m44());
- return transform;
-}
-} // namespace
-
+using webkit::WebTransformationMatrixUtil;
namespace WebKit {
@@ -193,7 +168,7 @@ void WebLayerImpl::setSublayerTransform(const SkMatrix44& matrix)
void WebLayerImpl::setSublayerTransform(const WebTransformationMatrix& matrix)
{
- m_layer->setSublayerTransform(convertWebTransformationMatrixToTransform(matrix));
+ m_layer->setSublayerTransform(WebTransformationMatrixUtil::ToTransform(matrix));
}
SkMatrix44 WebLayerImpl::sublayerTransform() const
@@ -210,7 +185,7 @@ void WebLayerImpl::setTransform(const SkMatrix44& matrix)
void WebLayerImpl::setTransform(const WebTransformationMatrix& matrix)
{
- m_layer->setTransform(convertWebTransformationMatrixToTransform(matrix));
+ m_layer->setTransform(WebTransformationMatrixUtil::ToTransform(matrix));
}
SkMatrix44 WebLayerImpl::transform() const
« no previous file with comments | « webkit/compositor_bindings/compositor_bindings.gyp ('k') | webkit/compositor_bindings/web_transform_animation_curve_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698