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

Unified 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: Set up impl-only timelines for ScrollOffset animations Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/blink/web_compositor_animation_timeline_impl.h ('k') | cc/blink/web_compositor_support_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_compositor_animation_timeline_impl.cc
diff --git a/cc/blink/web_compositor_animation_timeline_impl.cc b/cc/blink/web_compositor_animation_timeline_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..740f6593fcf43b6365b351b60e86e8bfbab57fc8
--- /dev/null
+++ b/cc/blink/web_compositor_animation_timeline_impl.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/blink/web_compositor_animation_timeline_impl.h"
+
+#include "cc/animation/animation_id_provider.h"
+#include "cc/animation/animation_timeline.h"
+#include "cc/blink/web_compositor_animation_player_impl.h"
+#include "third_party/WebKit/public/platform/WebCompositorAnimationPlayerClient.h"
+
+using cc::AnimationTimeline;
+
+namespace cc_blink {
+
+WebCompositorAnimationTimelineImpl::WebCompositorAnimationTimelineImpl()
+ : animation_timeline_(AnimationTimeline::Create(
+ cc::AnimationIdProvider::NextTimelineId())) {
+}
+
+WebCompositorAnimationTimelineImpl::~WebCompositorAnimationTimelineImpl() {
+}
+
+cc::AnimationTimeline* WebCompositorAnimationTimelineImpl::animation_timeline()
+ const {
+ return animation_timeline_.get();
+}
+
+void WebCompositorAnimationTimelineImpl::playerAttached(
+ const blink::WebCompositorAnimationPlayerClient& client) {
+ if (client.compositorPlayer())
+ animation_timeline_->AttachPlayer(
+ static_cast<WebCompositorAnimationPlayerImpl*>(
+ client.compositorPlayer())->animation_player());
+}
+
+void WebCompositorAnimationTimelineImpl::playerDestroyed(
+ const blink::WebCompositorAnimationPlayerClient& client) {
+ if (client.compositorPlayer())
+ animation_timeline_->DetachPlayer(
+ static_cast<WebCompositorAnimationPlayerImpl*>(
+ client.compositorPlayer())->animation_player());
+}
+
+} // namespace cc_blink
« no previous file with comments | « cc/blink/web_compositor_animation_timeline_impl.h ('k') | cc/blink/web_compositor_support_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698