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

Unified Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 11762003: Avoid depending on WebTransformationMatrix::toTransform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO Created 7 years, 12 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 | « cc/layer_animation_controller.cc ('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_layer_impl.cc
diff --git a/webkit/compositor_bindings/web_layer_impl.cc b/webkit/compositor_bindings/web_layer_impl.cc
index d73796ed3f21410a424ad589f523140624f80ec7..b33436a40c7baa72bdeb1556fc05d39fd31b6c9c 100644
--- a/webkit/compositor_bindings/web_layer_impl.cc
+++ b/webkit/compositor_bindings/web_layer_impl.cc
@@ -21,6 +21,33 @@
using cc::ActiveAnimation;
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
+
+
namespace WebKit {
WebLayerImpl::WebLayerImpl()
@@ -169,7 +196,7 @@ void WebLayerImpl::setSublayerTransform(const SkMatrix44& matrix)
void WebLayerImpl::setSublayerTransform(const WebTransformationMatrix& matrix)
{
- m_layer->setSublayerTransform(matrix.toTransform());
+ m_layer->setSublayerTransform(convertWebTransformationMatrixToTransform(matrix));
}
SkMatrix44 WebLayerImpl::sublayerTransform() const
@@ -186,7 +213,7 @@ void WebLayerImpl::setTransform(const SkMatrix44& matrix)
void WebLayerImpl::setTransform(const WebTransformationMatrix& matrix)
{
- m_layer->setTransform(matrix.toTransform());
+ m_layer->setTransform(convertWebTransformationMatrixToTransform(matrix));
}
SkMatrix44 WebLayerImpl::transform() const
« no previous file with comments | « cc/layer_animation_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698