| 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/compositor_bindings/web_animation_impl.h" | 5 #include "webkit/compositor_bindings/web_animation_impl.h" |
| 6 | 6 |
| 7 #include "cc/animation.h" | 7 #include "cc/animation.h" |
| 8 #include "cc/animation_curve.h" | 8 #include "cc/animation_curve.h" |
| 9 #include "cc/animation_id_provider.h" | 9 #include "cc/animation_id_provider.h" |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h
" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h
" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" | 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" |
| 12 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" | 12 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" |
| 13 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" | 13 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" |
| 14 | 14 |
| 15 using cc::Animation; | 15 using cc::Animation; |
| 16 using cc::AnimationIdProvider; | 16 using cc::AnimationIdProvider; |
| 17 | 17 |
| 18 namespace WebKit { | 18 using WebKit::WebAnimationCurve; |
| 19 |
| 20 namespace webkit { |
| 19 | 21 |
| 20 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& web_curve, | 22 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& web_curve, |
| 21 TargetProperty target_property, | 23 TargetProperty target_property, |
| 22 int animation_id, | 24 int animation_id, |
| 23 int group_id) { | 25 int group_id) { |
| 24 if (!animation_id) | 26 if (!animation_id) |
| 25 animation_id = AnimationIdProvider::NextAnimationId(); | 27 animation_id = AnimationIdProvider::NextAnimationId(); |
| 26 if (!group_id) | 28 if (!group_id) |
| 27 group_id = AnimationIdProvider::NextGroupId(); | 29 group_id = AnimationIdProvider::NextGroupId(); |
| 28 | 30 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 curve.Pass(), | 48 curve.Pass(), |
| 47 animation_id, | 49 animation_id, |
| 48 group_id, | 50 group_id, |
| 49 static_cast<cc::Animation::TargetProperty>(target_property)); | 51 static_cast<cc::Animation::TargetProperty>(target_property)); |
| 50 } | 52 } |
| 51 | 53 |
| 52 WebAnimationImpl::~WebAnimationImpl() {} | 54 WebAnimationImpl::~WebAnimationImpl() {} |
| 53 | 55 |
| 54 int WebAnimationImpl::id() { return animation_->id(); } | 56 int WebAnimationImpl::id() { return animation_->id(); } |
| 55 | 57 |
| 56 WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { | 58 WebKit::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { |
| 57 return static_cast<WebAnimationImpl::TargetProperty>( | 59 return static_cast<WebAnimationImpl::TargetProperty>( |
| 58 animation_->target_property()); | 60 animation_->target_property()); |
| 59 } | 61 } |
| 60 | 62 |
| 61 int WebAnimationImpl::iterations() const { return animation_->iterations(); } | 63 int WebAnimationImpl::iterations() const { return animation_->iterations(); } |
| 62 | 64 |
| 63 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } | 65 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } |
| 64 | 66 |
| 65 double WebAnimationImpl::startTime() const { return animation_->start_time(); } | 67 double WebAnimationImpl::startTime() const { return animation_->start_time(); } |
| 66 | 68 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 84 animation_->set_alternates_direction(alternates); | 86 animation_->set_alternates_direction(alternates); |
| 85 } | 87 } |
| 86 | 88 |
| 87 scoped_ptr<cc::Animation> WebAnimationImpl::cloneToAnimation() { | 89 scoped_ptr<cc::Animation> WebAnimationImpl::cloneToAnimation() { |
| 88 scoped_ptr<cc::Animation> to_return( | 90 scoped_ptr<cc::Animation> to_return( |
| 89 animation_->Clone(cc::Animation::NonControllingInstance)); | 91 animation_->Clone(cc::Animation::NonControllingInstance)); |
| 90 to_return->set_needs_synchronized_start_time(true); | 92 to_return->set_needs_synchronized_start_time(true); |
| 91 return to_return.Pass(); | 93 return to_return.Pass(); |
| 92 } | 94 } |
| 93 | 95 |
| 94 } // namespace WebKit | 96 } // namespace webkit |
| OLD | NEW |