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

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

Issue 192433002: Creating utility for converting TimeTicks to WebKit double and use it in the Chrome compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 #include "webkit/renderer/compositor_bindings/webkit_time.h"
8 9
9 namespace webkit { 10 namespace webkit {
10 11
11 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter( 12 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter(
12 blink::WebAnimationDelegate* delegate) 13 blink::WebAnimationDelegate* delegate)
13 : delegate_(delegate) {} 14 : delegate_(delegate) {}
14 15
15 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted( 16 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted(
16 base::TimeTicks monotonic_time, 17 base::TimeTicks monotonic_time,
17 cc::Animation::TargetProperty target_property) { 18 cc::Animation::TargetProperty target_property) {
18 delegate_->notifyAnimationStarted( 19 delegate_->notifyAnimationStarted(
19 (monotonic_time - base::TimeTicks()).InSecondsF(), 20 ToWebKitTime(monotonic_time),
jamesr 2014/03/10 20:37:28 what's wrong with this?
20 static_cast<blink::WebAnimation::TargetProperty>(target_property)); 21 static_cast<blink::WebAnimation::TargetProperty>(target_property));
21 } 22 }
22 23
23 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished( 24 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished(
24 base::TimeTicks monotonic_time, 25 base::TimeTicks monotonic_time,
25 cc::Animation::TargetProperty target_property) { 26 cc::Animation::TargetProperty target_property) {
26 delegate_->notifyAnimationFinished( 27 delegate_->notifyAnimationFinished(
27 (monotonic_time - base::TimeTicks()).InSecondsF(), 28 ToWebKitTime(monotonic_time),
28 static_cast<blink::WebAnimation::TargetProperty>(target_property)); 29 static_cast<blink::WebAnimation::TargetProperty>(target_property));
29 } 30 }
30 31
31 } // namespace webkit 32 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp ('k') | webkit/renderer/compositor_bindings/webkit_time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698