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

Side by Side Diff: cc/blink/web_compositor_animation_timeline_impl.cc

Issue 947033002: CC Animations: Establish AnimationHost, AnimationTimeline and AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove kEnableNewCompositorAnimations. Created 5 years, 9 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/blink/web_compositor_animation_timeline_impl.h"
6
7 #include "cc/animation/animation_timeline.h"
8 #include "cc/blink/web_compositor_animation_player_impl.h"
9 #include "third_party/WebKit/public/platform/WebCompositorAnimationPlayerClient. h"
10
11 using cc::AnimationTimeline;
12
13 namespace cc_blink {
14
15 WebCompositorAnimationTimelineImpl::WebCompositorAnimationTimelineImpl()
16 : animation_timeline_(AnimationTimeline::Create()) {
17 }
18
19 WebCompositorAnimationTimelineImpl::~WebCompositorAnimationTimelineImpl() {
20 }
21
22 cc::AnimationTimeline* WebCompositorAnimationTimelineImpl::animation_timeline()
23 const {
24 return animation_timeline_.get();
25 }
26
27 void WebCompositorAnimationTimelineImpl::playerAttached(
28 const blink::WebCompositorAnimationPlayerClient& client) {
29 if (client.compositorPlayer())
30 animation_timeline_->AttachPlayer(
31 static_cast<WebCompositorAnimationPlayerImpl*>(
32 client.compositorPlayer())->animation_player());
33 }
34
35 void WebCompositorAnimationTimelineImpl::playerDestroyed(
36 const blink::WebCompositorAnimationPlayerClient& client) {
37 if (client.compositorPlayer())
38 animation_timeline_->DetachPlayer(
39 static_cast<WebCompositorAnimationPlayerImpl*>(
40 client.compositorPlayer())->animation_player());
41 }
42
43 } // namespace cc_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698