OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/blink/web_to_cc_animation_delegate_adapter.h" | 5 #include "cc/blink/web_to_cc_animation_delegate_adapter.h" |
6 #include "third_party/WebKit/public/platform/WebCompositorAnimationDelegate.h" | 6 #include "third_party/WebKit/public/platform/WebCompositorAnimationDelegate.h" |
7 | 7 |
8 namespace cc_blink { | 8 namespace cc_blink { |
9 | 9 |
10 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter( | 10 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter( |
11 blink::WebCompositorAnimationDelegate* delegate) | 11 blink::WebCompositorAnimationDelegate* delegate) |
12 : delegate_(delegate) { | 12 : delegate_(delegate) { |
13 } | 13 } |
14 | 14 |
15 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted( | 15 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted( |
16 base::TimeTicks monotonic_time, | 16 base::TimeTicks monotonic_time, |
17 cc::Animation::TargetProperty target_property) { | 17 cc::Animation::TargetProperty target_property, |
| 18 int group) { |
18 delegate_->notifyAnimationStarted( | 19 delegate_->notifyAnimationStarted( |
19 (monotonic_time - base::TimeTicks()).InSecondsF(), | 20 (monotonic_time - base::TimeTicks()).InSecondsF(), |
| 21 #if WEB_COMPOSITOR_ANIMATION_DELEGATE_TAKES_GROUP |
| 22 group); |
| 23 #else |
20 static_cast<blink::WebCompositorAnimation::TargetProperty>( | 24 static_cast<blink::WebCompositorAnimation::TargetProperty>( |
21 target_property)); | 25 target_property)); |
| 26 #endif |
22 } | 27 } |
23 | 28 |
24 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished( | 29 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished( |
25 base::TimeTicks monotonic_time, | 30 base::TimeTicks monotonic_time, |
26 cc::Animation::TargetProperty target_property) { | 31 cc::Animation::TargetProperty target_property, |
| 32 int group) { |
27 delegate_->notifyAnimationFinished( | 33 delegate_->notifyAnimationFinished( |
28 (monotonic_time - base::TimeTicks()).InSecondsF(), | 34 (monotonic_time - base::TimeTicks()).InSecondsF(), |
| 35 #if WEB_COMPOSITOR_ANIMATION_DELEGATE_TAKES_GROUP |
| 36 group); |
| 37 #else |
29 static_cast<blink::WebCompositorAnimation::TargetProperty>( | 38 static_cast<blink::WebCompositorAnimation::TargetProperty>( |
30 target_property)); | 39 target_property)); |
| 40 #endif |
31 } | 41 } |
32 | 42 |
33 } // namespace cc_blink | 43 } // namespace cc_blink |
OLD | NEW |