summaryrefslogtreecommitdiffstats
path: root/cc/layer_animation_controller.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-04 00:09:37 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-04 00:09:37 +0000
commit0e6ebab5323d7886f022f04475f7ef8b07e5a2b9 (patch)
treea5ab153bec8a1978b4805418ad3209ffbf94ab81 /cc/layer_animation_controller.cc
parent2e357e510f6d9fdd1631e681ee13e835e0eeac35 (diff)
downloadchromium_src-0e6ebab5323d7886f022f04475f7ef8b07e5a2b9.zip
chromium_src-0e6ebab5323d7886f022f04475f7ef8b07e5a2b9.tar.gz
chromium_src-0e6ebab5323d7886f022f04475f7ef8b07e5a2b9.tar.bz2
Avoid depending on WebTransformationMatrix::toTransform
In order to stop aliasing memory for WebTransformationMatrix with a WebCore type we need to make storage for that class private which means we can't provide any conversions to gfx::Transform in WebTransformationMatrix.h. This does explicit per-member conversion on the chromium side. The conversion in cc/layer_animation_controller.cc is going away real soon now, so I copied the function there instead of trying to find a place where both could depend on it. BUG= Review URL: https://chromiumcodereview.appspot.com/11762003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_animation_controller.cc')
-rw-r--r--cc/layer_animation_controller.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/cc/layer_animation_controller.cc b/cc/layer_animation_controller.cc
index c72df04..06b22bc 100644
--- a/cc/layer_animation_controller.cc
+++ b/cc/layer_animation_controller.cc
@@ -10,6 +10,30 @@
#include "cc/layer_animation_value_observer.h"
#include "ui/gfx/transform.h"
+namespace {
+gfx::Transform convertWebTransformationMatrixToTransform(const WebKit::WebTransformationMatrix& matrix)
+{
+ 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 cc {
LayerAnimationController::LayerAnimationController(int id)
@@ -406,7 +430,7 @@ void LayerAnimationController::tickAnimations(double monotonicTime)
case ActiveAnimation::Transform: {
const TransformAnimationCurve* transformAnimationCurve = m_activeAnimations[i]->curve()->toTransformAnimationCurve();
- const gfx::Transform transform = transformAnimationCurve->getValue(trimmed).toTransform();
+ const gfx::Transform transform = convertWebTransformationMatrixToTransform(transformAnimationCurve->getValue(trimmed));
if (m_activeAnimations[i]->isFinishedAt(monotonicTime))
m_activeAnimations[i]->setRunState(ActiveAnimation::Finished, monotonicTime);