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 |