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

Side by Side Diff: webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc

Issue 99733003: Add monotonic time and target property to cc::AnimationDelegate notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h" 5 #include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h"
6 6
7 #include "third_party/WebKit/public/platform/WebAnimationDelegate.h" 7 #include "third_party/WebKit/public/platform/WebAnimationDelegate.h"
8 8
9 namespace webkit { 9 namespace webkit {
10 10
11 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter( 11 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter(
12 blink::WebAnimationDelegate* delegate) 12 blink::WebAnimationDelegate* delegate)
13 : delegate_(delegate) {} 13 : delegate_(delegate) {}
14 14
15 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted(double time) { 15 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted(
16 delegate_->notifyAnimationStarted(time); 16 double wall_clock_time,
17 base::TimeTicks monotonic_time,
18 cc::Animation::TargetProperty target_property) {
19 #if WEB_ANIMATION_DELEGATE_TAKES_MONOTONIC_TIME
20 delegate_->notifyAnimationStarted(
21 wall_clock_time,
22 (monotonic_time - base::TimeTicks()).InSecondsF(),
23 static_cast<blink::WebAnimation::TargetProperty>(target_property));
24 #else
25 delegate_->notifyAnimationStarted(wall_clock_time);
26 #endif
17 } 27 }
18 28
19 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished(double time) { 29 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished(
20 delegate_->notifyAnimationFinished(time); 30 double wall_clock_time,
31 base::TimeTicks monotonic_time,
32 cc::Animation::TargetProperty target_property) {
33 #if WEB_ANIMATION_DELEGATE_TAKES_MONOTONIC_TIME
34 delegate_->notifyAnimationFinished(
35 wall_clock_time,
36 (monotonic_time - base::TimeTicks()).InSecondsF(),
37 static_cast<blink::WebAnimation::TargetProperty>(target_property));
38 #else
39 delegate_->notifyAnimationFinished(wall_clock_time);
40 #endif
21 } 41 }
22 42
23 } // namespace webkit 43 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698