Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Side by Side Diff: third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::attachLayer(WebLayer* webLayer) 41 void CompositorAnimationPlayer::attachElement(CompositorElementId elementId)
42 { 42 {
43 m_animationPlayer->AttachElement(webLayer->id()); 43 m_animationPlayer->AttachElement(elementId);
44 } 44 }
45 45
46 void CompositorAnimationPlayer::detachLayer() 46 void CompositorAnimationPlayer::detachElement()
47 { 47 {
48 m_animationPlayer->DetachElement(); 48 m_animationPlayer->DetachElement();
49 } 49 }
50 50
51 bool CompositorAnimationPlayer::isLayerAttached() const 51 bool CompositorAnimationPlayer::isElementAttached() const
52 { 52 {
53 return m_animationPlayer->element_id() != 0; 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
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698