OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/animation/CompositorFloatAnimationCurve.h" | 5 #include "platform/animation/CompositorFloatAnimationCurve.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 "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 CompositorFloatAnimationCurve::CompositorFloatAnimationCurve() | 15 CompositorFloatAnimationCurve::CompositorFloatAnimationCurve() |
16 : m_curve(cc::KeyframedFloatAnimationCurve::Create()) {} | 16 : m_curve(cc::KeyframedFloatAnimationCurve::Create()) {} |
17 | 17 |
18 CompositorFloatAnimationCurve::CompositorFloatAnimationCurve( | 18 CompositorFloatAnimationCurve::CompositorFloatAnimationCurve( |
19 std::unique_ptr<cc::KeyframedFloatAnimationCurve> curve) | 19 std::unique_ptr<cc::KeyframedFloatAnimationCurve> curve) |
20 : m_curve(std::move(curve)) {} | 20 : m_curve(std::move(curve)) {} |
21 | 21 |
22 CompositorFloatAnimationCurve::~CompositorFloatAnimationCurve() {} | 22 CompositorFloatAnimationCurve::~CompositorFloatAnimationCurve() {} |
23 | 23 |
24 std::unique_ptr<CompositorFloatAnimationCurve> | 24 std::unique_ptr<CompositorFloatAnimationCurve> |
25 CompositorFloatAnimationCurve::createForTesting( | 25 CompositorFloatAnimationCurve::createForTesting( |
26 std::unique_ptr<cc::KeyframedFloatAnimationCurve> curve) { | 26 std::unique_ptr<cc::KeyframedFloatAnimationCurve> curve) { |
27 return wrapUnique(new CompositorFloatAnimationCurve(std::move(curve))); | 27 return WTF::wrapUnique(new CompositorFloatAnimationCurve(std::move(curve))); |
28 } | 28 } |
29 | 29 |
30 CompositorFloatAnimationCurve::Keyframes | 30 CompositorFloatAnimationCurve::Keyframes |
31 CompositorFloatAnimationCurve::keyframesForTesting() const { | 31 CompositorFloatAnimationCurve::keyframesForTesting() const { |
32 Keyframes keyframes; | 32 Keyframes keyframes; |
33 for (const auto& ccKeyframe : m_curve->keyframes_for_testing()) | 33 for (const auto& ccKeyframe : m_curve->keyframes_for_testing()) { |
34 keyframes.append( | 34 keyframes.append( |
35 wrapUnique(new CompositorFloatKeyframe(ccKeyframe->Clone()))); | 35 WTF::wrapUnique(new CompositorFloatKeyframe(ccKeyframe->Clone()))); |
| 36 } |
36 return keyframes; | 37 return keyframes; |
37 } | 38 } |
38 | 39 |
39 PassRefPtr<TimingFunction> | 40 PassRefPtr<TimingFunction> |
40 CompositorFloatAnimationCurve::getTimingFunctionForTesting() const { | 41 CompositorFloatAnimationCurve::getTimingFunctionForTesting() const { |
41 return createCompositorTimingFunctionFromCC( | 42 return createCompositorTimingFunctionFromCC( |
42 m_curve->timing_function_for_testing()); | 43 m_curve->timing_function_for_testing()); |
43 } | 44 } |
44 | 45 |
45 void CompositorFloatAnimationCurve::addKeyframe( | 46 void CompositorFloatAnimationCurve::addKeyframe( |
(...skipping 13 matching lines...) Expand all Loading... |
59 float CompositorFloatAnimationCurve::getValue(double time) const { | 60 float CompositorFloatAnimationCurve::getValue(double time) const { |
60 return m_curve->GetValue(base::TimeDelta::FromSecondsD(time)); | 61 return m_curve->GetValue(base::TimeDelta::FromSecondsD(time)); |
61 } | 62 } |
62 | 63 |
63 std::unique_ptr<cc::AnimationCurve> | 64 std::unique_ptr<cc::AnimationCurve> |
64 CompositorFloatAnimationCurve::cloneToAnimationCurve() const { | 65 CompositorFloatAnimationCurve::cloneToAnimationCurve() const { |
65 return m_curve->Clone(); | 66 return m_curve->Clone(); |
66 } | 67 } |
67 | 68 |
68 } // namespace blink | 69 } // namespace blink |
OLD | NEW |