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/CompositorAnimationPlayer.h" | 5 #include "platform/animation/CompositorAnimationPlayer.h" |
6 | 6 |
7 #include "cc/animation/animation_id_provider.h" | 7 #include "cc/animation/animation_id_provider.h" |
8 #include "cc/animation/animation_timeline.h" | 8 #include "cc/animation/animation_timeline.h" |
9 #include "platform/animation/CompositorAnimation.h" | 9 #include "platform/animation/CompositorAnimation.h" |
10 #include "platform/animation/CompositorAnimationDelegate.h" | 10 #include "platform/animation/CompositorAnimationDelegate.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 { | 31 { |
32 return m_animationPlayer.get(); | 32 return m_animationPlayer.get(); |
33 } | 33 } |
34 | 34 |
35 void CompositorAnimationPlayer::setAnimationDelegate(CompositorAnimationDelegate
* delegate) | 35 void CompositorAnimationPlayer::setAnimationDelegate(CompositorAnimationDelegate
* delegate) |
36 { | 36 { |
37 m_delegate = delegate; | 37 m_delegate = delegate; |
38 m_animationPlayer->set_animation_delegate(delegate ? this : nullptr); | 38 m_animationPlayer->set_animation_delegate(delegate ? this : nullptr); |
39 } | 39 } |
40 | 40 |
41 void CompositorAnimationPlayer::attachElement(const CompositorElementId& id) | 41 void CompositorAnimationPlayer::attachLayer(WebLayer* webLayer) |
42 { | 42 { |
43 m_animationPlayer->AttachElement(id); | 43 m_animationPlayer->AttachElement(webLayer->id()); |
44 } | 44 } |
45 | 45 |
46 void CompositorAnimationPlayer::detachElement() | 46 void CompositorAnimationPlayer::detachLayer() |
47 { | 47 { |
48 m_animationPlayer->DetachElement(); | 48 m_animationPlayer->DetachElement(); |
49 } | 49 } |
50 | 50 |
51 bool CompositorAnimationPlayer::isElementAttached() const | 51 bool CompositorAnimationPlayer::isLayerAttached() const |
52 { | 52 { |
53 return !!m_animationPlayer->element_id(); | 53 return m_animationPlayer->element_id() != 0; |
54 } | 54 } |
55 | 55 |
56 void CompositorAnimationPlayer::addAnimation(CompositorAnimation* animation) | 56 void CompositorAnimationPlayer::addAnimation(CompositorAnimation* animation) |
57 { | 57 { |
58 m_animationPlayer->AddAnimation(animation->passAnimation()); | 58 m_animationPlayer->AddAnimation(animation->passAnimation()); |
59 delete animation; | 59 delete animation; |
60 } | 60 } |
61 | 61 |
62 void CompositorAnimationPlayer::removeAnimation(uint64_t animationId) | 62 void CompositorAnimationPlayer::removeAnimation(int animationId) |
63 { | 63 { |
64 m_animationPlayer->RemoveAnimation(animationId); | 64 m_animationPlayer->RemoveAnimation(animationId); |
65 } | 65 } |
66 | 66 |
67 void CompositorAnimationPlayer::pauseAnimation(uint64_t animationId, double time
Offset) | 67 void CompositorAnimationPlayer::pauseAnimation(int animationId, double timeOffse
t) |
68 { | 68 { |
69 m_animationPlayer->PauseAnimation(animationId, timeOffset); | 69 m_animationPlayer->PauseAnimation(animationId, timeOffset); |
70 } | 70 } |
71 | 71 |
72 void CompositorAnimationPlayer::abortAnimation(uint64_t animationId) | 72 void CompositorAnimationPlayer::abortAnimation(int animationId) |
73 { | 73 { |
74 m_animationPlayer->AbortAnimation(animationId); | 74 m_animationPlayer->AbortAnimation(animationId); |
75 } | 75 } |
76 | 76 |
77 void CompositorAnimationPlayer::NotifyAnimationStarted( | 77 void CompositorAnimationPlayer::NotifyAnimationStarted( |
78 base::TimeTicks monotonicTime, | 78 base::TimeTicks monotonicTime, |
79 cc::TargetProperty::Type targetProperty, | 79 cc::TargetProperty::Type targetProperty, |
80 int group) | 80 int group) |
81 { | 81 { |
82 if (m_delegate) | 82 if (m_delegate) |
(...skipping 26 matching lines...) Expand all Loading... |
109 { | 109 { |
110 if (m_delegate) { | 110 if (m_delegate) { |
111 m_delegate->notifyAnimationTakeover( | 111 m_delegate->notifyAnimationTakeover( |
112 (monotonicTime - base::TimeTicks()).InSecondsF(), | 112 (monotonicTime - base::TimeTicks()).InSecondsF(), |
113 animationStartTime, | 113 animationStartTime, |
114 std::move(curve)); | 114 std::move(curve)); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
OLD | NEW |