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> | |
17 | 16 |
18 using cc::Animation; | 17 using cc::Animation; |
19 using cc::AnimationIdProvider; | 18 using cc::AnimationIdProvider; |
20 | 19 |
21 using blink::CompositorAnimation; | 20 using blink::CompositorAnimation; |
22 using blink::CompositorAnimationCurve; | 21 using blink::CompositorAnimationCurve; |
23 | 22 |
24 namespace blink { | 23 namespace blink { |
25 | 24 |
26 CompositorAnimation::CompositorAnimation(const CompositorAnimationCurve& curve,
CompositorTargetProperty::Type targetProperty, int animationId, int groupId) | 25 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... |
120 { | 119 { |
121 m_animation->set_fill_mode(fillMode); | 120 m_animation->set_fill_mode(fillMode); |
122 } | 121 } |
123 | 122 |
124 std::unique_ptr<cc::Animation> CompositorAnimation::passAnimation() | 123 std::unique_ptr<cc::Animation> CompositorAnimation::passAnimation() |
125 { | 124 { |
126 m_animation->set_needs_synchronized_start_time(true); | 125 m_animation->set_needs_synchronized_start_time(true); |
127 return std::move(m_animation); | 126 return std::move(m_animation); |
128 } | 127 } |
129 | 128 |
130 std::unique_ptr<CompositorFloatAnimationCurve> CompositorAnimation::floatCurveFo
rTesting() const | 129 PassOwnPtr<CompositorFloatAnimationCurve> CompositorAnimation::floatCurveForTest
ing() const |
131 { | 130 { |
132 const cc::AnimationCurve* curve = m_animation->curve(); | 131 const cc::AnimationCurve* curve = m_animation->curve(); |
133 DCHECK_EQ(cc::AnimationCurve::FLOAT, curve->Type()); | 132 DCHECK_EQ(cc::AnimationCurve::FLOAT, curve->Type()); |
134 | 133 |
135 auto keyframedCurve = base::WrapUnique(static_cast<cc::KeyframedFloatAnimati
onCurve*>(curve->Clone().release())); | 134 auto keyframedCurve = base::WrapUnique(static_cast<cc::KeyframedFloatAnimati
onCurve*>(curve->Clone().release())); |
136 return CompositorFloatAnimationCurve::CreateForTesting(std::move(keyframedCu
rve)); | 135 return CompositorFloatAnimationCurve::CreateForTesting(std::move(keyframedCu
rve)); |
137 } | 136 } |
138 | 137 |
139 } // namespace blink | 138 } // namespace blink |
OLD | NEW |