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/renderer/compositor_bindings/web_float_animation_curve_impl.h" | 5 #include "content/renderer/compositor_bindings/web_float_animation_curve_impl.h" |
6 | 6 |
7 #include "cc/animation/animation_curve.h" | 7 #include "cc/animation/animation_curve.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/timing_function.h" | 9 #include "cc/animation/timing_function.h" |
10 #include "webkit/renderer/compositor_bindings/web_animation_curve_common.h" | 10 #include "content/renderer/compositor_bindings/web_animation_curve_common.h" |
11 | 11 |
12 using blink::WebFloatKeyframe; | 12 using blink::WebFloatKeyframe; |
13 | 13 |
14 namespace webkit { | 14 namespace content { |
15 | 15 |
16 WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl() | 16 WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl() |
17 : curve_(cc::KeyframedFloatAnimationCurve::Create()) {} | 17 : curve_(cc::KeyframedFloatAnimationCurve::Create()) { |
| 18 } |
18 | 19 |
19 WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl() {} | 20 WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl() { |
| 21 } |
20 | 22 |
21 blink::WebAnimationCurve::AnimationCurveType | 23 blink::WebAnimationCurve::AnimationCurveType |
22 WebFloatAnimationCurveImpl::type() const { | 24 WebFloatAnimationCurveImpl::type() const { |
23 return blink::WebAnimationCurve::AnimationCurveTypeFloat; | 25 return blink::WebAnimationCurve::AnimationCurveTypeFloat; |
24 } | 26 } |
25 | 27 |
26 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe) { | 28 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe) { |
27 add(keyframe, TimingFunctionTypeEase); | 29 add(keyframe, TimingFunctionTypeEase); |
28 } | 30 } |
29 | 31 |
30 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, | 32 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, |
31 TimingFunctionType type) { | 33 TimingFunctionType type) { |
32 curve_->AddKeyframe(cc::FloatKeyframe::Create( | 34 curve_->AddKeyframe(cc::FloatKeyframe::Create( |
(...skipping 14 matching lines...) Expand all Loading... |
47 | 49 |
48 float WebFloatAnimationCurveImpl::getValue(double time) const { | 50 float WebFloatAnimationCurveImpl::getValue(double time) const { |
49 return curve_->GetValue(time); | 51 return curve_->GetValue(time); |
50 } | 52 } |
51 | 53 |
52 scoped_ptr<cc::AnimationCurve> | 54 scoped_ptr<cc::AnimationCurve> |
53 WebFloatAnimationCurveImpl::CloneToAnimationCurve() const { | 55 WebFloatAnimationCurveImpl::CloneToAnimationCurve() const { |
54 return curve_->Clone(); | 56 return curve_->Clone(); |
55 } | 57 } |
56 | 58 |
57 } // namespace webkit | 59 } // namespace content |
| 60 |
OLD | NEW |