| 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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 WTF::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.push_back( |
| 35 WTF::wrapUnique(new CompositorFloatKeyframe(ccKeyframe->Clone()))); | 35 WTF::wrapUnique(new CompositorFloatKeyframe(ccKeyframe->Clone()))); |
| 36 } | 36 } |
| 37 return keyframes; | 37 return keyframes; |
| 38 } | 38 } |
| 39 | 39 |
| 40 PassRefPtr<TimingFunction> | 40 PassRefPtr<TimingFunction> |
| 41 CompositorFloatAnimationCurve::getTimingFunctionForTesting() const { | 41 CompositorFloatAnimationCurve::getTimingFunctionForTesting() const { |
| 42 return createCompositorTimingFunctionFromCC( | 42 return createCompositorTimingFunctionFromCC( |
| 43 m_curve->timing_function_for_testing()); | 43 m_curve->timing_function_for_testing()); |
| 44 } | 44 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 60 float CompositorFloatAnimationCurve::getValue(double time) const { | 60 float CompositorFloatAnimationCurve::getValue(double time) const { |
| 61 return m_curve->GetValue(base::TimeDelta::FromSecondsD(time)); | 61 return m_curve->GetValue(base::TimeDelta::FromSecondsD(time)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::unique_ptr<cc::AnimationCurve> | 64 std::unique_ptr<cc::AnimationCurve> |
| 65 CompositorFloatAnimationCurve::cloneToAnimationCurve() const { | 65 CompositorFloatAnimationCurve::cloneToAnimationCurve() const { |
| 66 return m_curve->Clone(); | 66 return m_curve->Clone(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |