| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" | 5 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" |
| 6 | 6 |
| 7 #include "cc/keyframed_animation_curve.h" | 7 #include "cc/keyframed_animation_curve.h" |
| 8 #include "cc/timing_function.h" | 8 #include "cc/timing_function.h" |
| 9 #include "cc/transform_operations.h" | 9 #include "cc/transform_operations.h" |
| 10 #include "webkit/compositor_bindings/web_animation_curve_common.h" | 10 #include "webkit/compositor_bindings/web_animation_curve_common.h" |
| 11 #include "webkit/compositor_bindings/web_transform_operations_impl.h" | 11 #include "webkit/compositor_bindings/web_transform_operations_impl.h" |
| 12 #include "webkit/compositor_bindings/web_transformation_matrix_util.h" |
| 12 | 13 |
| 13 namespace WebKit { | 14 namespace WebKit { |
| 14 | 15 |
| 15 WebTransformAnimationCurveImpl::WebTransformAnimationCurveImpl() | 16 WebTransformAnimationCurveImpl::WebTransformAnimationCurveImpl() |
| 16 : m_curve(cc::KeyframedTransformAnimationCurve::create()) | 17 : m_curve(cc::KeyframedTransformAnimationCurve::create()) |
| 17 { | 18 { |
| 18 } | 19 } |
| 19 | 20 |
| 20 WebTransformAnimationCurveImpl::~WebTransformAnimationCurveImpl() | 21 WebTransformAnimationCurveImpl::~WebTransformAnimationCurveImpl() |
| 21 { | 22 { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d
ouble x1, double y1, double x2, double y2) | 42 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d
ouble x1, double y1, double x2, double y2) |
| 42 { | 43 { |
| 43 const cc::TransformOperations& transformOperations = | 44 const cc::TransformOperations& transformOperations = |
| 44 static_cast<const webkit::WebTransformOperationsImpl&>(keyframe.value())
.AsTransformOperations(); | 45 static_cast<const webkit::WebTransformOperationsImpl&>(keyframe.value())
.AsTransformOperations(); |
| 45 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), transfor
mOperations, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::Ti
mingFunction>())); | 46 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), transfor
mOperations, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::Ti
mingFunction>())); |
| 46 } | 47 } |
| 47 | 48 |
| 48 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co
nst | 49 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co
nst |
| 49 { | 50 { |
| 50 return m_curve->getValue(time); | 51 return webkit::WebTransformationMatrixUtil::ToWebTransformationMatrix(m_curv
e->getValue(time)); |
| 51 } | 52 } |
| 52 | 53 |
| 53 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC
urve() const | 54 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC
urve() const |
| 54 { | 55 { |
| 55 return m_curve->clone(); | 56 return m_curve->clone(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 } // namespace WebKit | 59 } // namespace WebKit |
| OLD | NEW |