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/CompositorAnimation.h" | 5 #include "platform/animation/CompositorAnimation.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
10 #include "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
11 #include "platform/animation/CompositorAnimationCurve.h" | 11 #include "platform/animation/CompositorAnimationCurve.h" |
12 #include "platform/animation/CompositorFilterAnimationCurve.h" | 12 #include "platform/animation/CompositorFilterAnimationCurve.h" |
13 #include "platform/animation/CompositorFloatAnimationCurve.h" | 13 #include "platform/animation/CompositorFloatAnimationCurve.h" |
14 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h" | 14 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h" |
15 #include "platform/animation/CompositorTransformAnimationCurve.h" | 15 #include "platform/animation/CompositorTransformAnimationCurve.h" |
| 16 #include <memory> |
16 | 17 |
17 using cc::Animation; | 18 using cc::Animation; |
18 using cc::AnimationIdProvider; | 19 using cc::AnimationIdProvider; |
19 | 20 |
20 using blink::CompositorAnimation; | 21 using blink::CompositorAnimation; |
21 using blink::CompositorAnimationCurve; | 22 using blink::CompositorAnimationCurve; |
22 | 23 |
23 namespace blink { | 24 namespace blink { |
24 | 25 |
25 CompositorAnimation::CompositorAnimation(const CompositorAnimationCurve& curve,
CompositorTargetProperty::Type targetProperty, int animationId, int groupId) | 26 CompositorAnimation::CompositorAnimation(const CompositorAnimationCurve& curve,
CompositorTargetProperty::Type targetProperty, int animationId, int groupId) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 { | 120 { |
120 m_animation->set_fill_mode(fillMode); | 121 m_animation->set_fill_mode(fillMode); |
121 } | 122 } |
122 | 123 |
123 std::unique_ptr<cc::Animation> CompositorAnimation::passAnimation() | 124 std::unique_ptr<cc::Animation> CompositorAnimation::passAnimation() |
124 { | 125 { |
125 m_animation->set_needs_synchronized_start_time(true); | 126 m_animation->set_needs_synchronized_start_time(true); |
126 return std::move(m_animation); | 127 return std::move(m_animation); |
127 } | 128 } |
128 | 129 |
129 PassOwnPtr<CompositorFloatAnimationCurve> CompositorAnimation::floatCurveForTest
ing() const | 130 std::unique_ptr<CompositorFloatAnimationCurve> CompositorAnimation::floatCurveFo
rTesting() const |
130 { | 131 { |
131 const cc::AnimationCurve* curve = m_animation->curve(); | 132 const cc::AnimationCurve* curve = m_animation->curve(); |
132 DCHECK_EQ(cc::AnimationCurve::FLOAT, curve->Type()); | 133 DCHECK_EQ(cc::AnimationCurve::FLOAT, curve->Type()); |
133 | 134 |
134 auto keyframedCurve = base::WrapUnique(static_cast<cc::KeyframedFloatAnimati
onCurve*>(curve->Clone().release())); | 135 auto keyframedCurve = base::WrapUnique(static_cast<cc::KeyframedFloatAnimati
onCurve*>(curve->Clone().release())); |
135 return CompositorFloatAnimationCurve::CreateForTesting(std::move(keyframedCu
rve)); | 136 return CompositorFloatAnimationCurve::CreateForTesting(std::move(keyframedCu
rve)); |
136 } | 137 } |
137 | 138 |
138 } // namespace blink | 139 } // namespace blink |
OLD | NEW |