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 "web_transform_animation_curve_impl.h" | 5 #include "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 "web_animation_curve_common.h" | 9 #include "web_animation_curve_common.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... | |
24 return WebAnimationCurve::AnimationCurveTypeTransform; | 24 return WebAnimationCurve::AnimationCurveTypeTransform; |
25 } | 25 } |
26 | 26 |
27 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe) | 27 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe) |
28 { | 28 { |
29 add(keyframe, TimingFunctionTypeEase); | 29 add(keyframe, TimingFunctionTypeEase); |
30 } | 30 } |
31 | 31 |
32 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, T imingFunctionType type) | 32 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, T imingFunctionType type) |
33 { | 33 { |
34 #ifdef WEBKIT_WEB_TRANSFORM_OPERATIONS_USE_CREATE | |
35 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), keyframe .value(), createTimingFunction(type))); | |
ajuma
2012/12/20 16:48:11
WebTransformKeyframe will no longer be able to dir
| |
36 #else | |
34 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, createTimingFunction(type))); | 37 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, createTimingFunction(type))); |
38 #endif | |
35 } | 39 } |
36 | 40 |
37 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d ouble x1, double y1, double x2, double y2) | 41 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d ouble x1, double y1, double x2, double y2) |
38 { | 42 { |
43 #ifdef WEBKIT_WEB_TRANSFORM_OPERATIONS_USE_CREATE | |
44 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), keyframe .value(), cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::Timin gFunction>())); | |
45 #else | |
39 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFun ction>())); | 46 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFun ction>())); |
47 #endif | |
40 } | 48 } |
41 | 49 |
42 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co nst | 50 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co nst |
43 { | 51 { |
44 return m_curve->getValue(time); | 52 return m_curve->getValue(time); |
45 } | 53 } |
46 | 54 |
47 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC urve() const | 55 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC urve() const |
48 { | 56 { |
49 return m_curve->clone(); | 57 return m_curve->clone(); |
50 } | 58 } |
51 | 59 |
52 } // namespace WebKit | 60 } // namespace WebKit |
OLD | NEW |