OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_animation_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_animation_impl.h" |
6 | 6 |
7 #include "cc/animation/animation.h" | 7 #include "cc/animation/animation.h" |
8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
10 #include "third_party/WebKit/public/platform/WebAnimation.h" | 10 #include "third_party/WebKit/public/platform/WebAnimation.h" |
11 #include "third_party/WebKit/public/platform/WebAnimationCurve.h" | 11 #include "third_party/WebKit/public/platform/WebAnimationCurve.h" |
12 #include "webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.h" | 12 #include "webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.h" |
13 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h" | 13 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h" |
14 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl
.h" | 14 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl
.h" |
15 | 15 |
16 using cc::Animation; | 16 using cc::Animation; |
17 using cc::AnimationIdProvider; | 17 using cc::AnimationIdProvider; |
18 | 18 |
19 using WebKit::WebAnimation; | 19 using blink::WebAnimation; |
20 using WebKit::WebAnimationCurve; | 20 using blink::WebAnimationCurve; |
21 | 21 |
22 namespace webkit { | 22 namespace webkit { |
23 | 23 |
24 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& web_curve, | 24 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& web_curve, |
25 TargetProperty target_property, | 25 TargetProperty target_property, |
26 int animation_id, | 26 int animation_id, |
27 int group_id) { | 27 int group_id) { |
28 if (!animation_id) | 28 if (!animation_id) |
29 animation_id = AnimationIdProvider::NextAnimationId(); | 29 animation_id = AnimationIdProvider::NextAnimationId(); |
30 if (!group_id) | 30 if (!group_id) |
(...skipping 25 matching lines...) Expand all Loading... |
56 curve.Pass(), | 56 curve.Pass(), |
57 animation_id, | 57 animation_id, |
58 group_id, | 58 group_id, |
59 static_cast<cc::Animation::TargetProperty>(target_property)); | 59 static_cast<cc::Animation::TargetProperty>(target_property)); |
60 } | 60 } |
61 | 61 |
62 WebAnimationImpl::~WebAnimationImpl() {} | 62 WebAnimationImpl::~WebAnimationImpl() {} |
63 | 63 |
64 int WebAnimationImpl::id() { return animation_->id(); } | 64 int WebAnimationImpl::id() { return animation_->id(); } |
65 | 65 |
66 WebKit::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { | 66 blink::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { |
67 return static_cast<WebAnimationImpl::TargetProperty>( | 67 return static_cast<WebAnimationImpl::TargetProperty>( |
68 animation_->target_property()); | 68 animation_->target_property()); |
69 } | 69 } |
70 | 70 |
71 int WebAnimationImpl::iterations() const { return animation_->iterations(); } | 71 int WebAnimationImpl::iterations() const { return animation_->iterations(); } |
72 | 72 |
73 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } | 73 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } |
74 | 74 |
75 double WebAnimationImpl::startTime() const { return animation_->start_time(); } | 75 double WebAnimationImpl::startTime() const { return animation_->start_time(); } |
76 | 76 |
(...skipping 27 matching lines...) Expand all Loading... |
104 mismatching_enums) | 104 mismatching_enums) |
105 | 105 |
106 COMPILE_ASSERT_MATCHING_ENUMS( | 106 COMPILE_ASSERT_MATCHING_ENUMS( |
107 WebAnimation::TargetPropertyTransform, Animation::Transform); | 107 WebAnimation::TargetPropertyTransform, Animation::Transform); |
108 COMPILE_ASSERT_MATCHING_ENUMS( | 108 COMPILE_ASSERT_MATCHING_ENUMS( |
109 WebAnimation::TargetPropertyOpacity, Animation::Opacity); | 109 WebAnimation::TargetPropertyOpacity, Animation::Opacity); |
110 COMPILE_ASSERT_MATCHING_ENUMS( | 110 COMPILE_ASSERT_MATCHING_ENUMS( |
111 WebAnimation::TargetPropertyFilter, Animation::Filter); | 111 WebAnimation::TargetPropertyFilter, Animation::Filter); |
112 | 112 |
113 } // namespace webkit | 113 } // namespace webkit |
OLD | NEW |