| 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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 animation_ = Animation::Create( | 47 animation_ = Animation::Create( |
| 48 curve.Pass(), | 48 curve.Pass(), |
| 49 animation_id, | 49 animation_id, |
| 50 group_id, | 50 group_id, |
| 51 static_cast<cc::Animation::TargetProperty>(target_property)); | 51 static_cast<cc::Animation::TargetProperty>(target_property)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 WebAnimationImpl::~WebAnimationImpl() {} | 54 WebAnimationImpl::~WebAnimationImpl() {} |
| 55 | 55 |
| 56 int WebAnimationImpl::id() { return animation_->id(); } | 56 int WebAnimationImpl::id() { return Animation()->id(); } |
| 57 | 57 |
| 58 WebKit::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { | 58 WebKit::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { |
| 59 return static_cast<WebAnimationImpl::TargetProperty>( | 59 return static_cast<WebAnimationImpl::TargetProperty>( |
| 60 animation_->target_property()); | 60 Animation()->target_property()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 int WebAnimationImpl::iterations() const { return animation_->iterations(); } | 63 int WebAnimationImpl::iterations() const { return Animation()->iterations(); } |
| 64 | 64 |
| 65 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } | 65 void WebAnimationImpl::setIterations(int n) { Animation()->set_iterations(n); } |
| 66 | 66 |
| 67 double WebAnimationImpl::startTime() const { return animation_->start_time(); } | 67 double WebAnimationImpl::startTime() const { return Animation()->start_time(); } |
| 68 | 68 |
| 69 void WebAnimationImpl::setStartTime(double monotonic_time) { | 69 void WebAnimationImpl::setStartTime(double monotonic_time) { |
| 70 animation_->set_start_time(monotonic_time); | 70 Animation()->set_start_time(monotonic_time); |
| 71 } | 71 } |
| 72 | 72 |
| 73 double WebAnimationImpl::timeOffset() const { | 73 double WebAnimationImpl::timeOffset() const { |
| 74 return animation_->time_offset(); | 74 return Animation()->time_offset(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void WebAnimationImpl::setTimeOffset(double monotonic_time) { | 77 void WebAnimationImpl::setTimeOffset(double monotonic_time) { |
| 78 animation_->set_time_offset(monotonic_time); | 78 Animation()->set_time_offset(monotonic_time); |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool WebAnimationImpl::alternatesDirection() const { | 81 bool WebAnimationImpl::alternatesDirection() const { |
| 82 return animation_->alternates_direction(); | 82 return Animation()->alternates_direction(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void WebAnimationImpl::setAlternatesDirection(bool alternates) { | 85 void WebAnimationImpl::setAlternatesDirection(bool alternates) { |
| 86 animation_->set_alternates_direction(alternates); | 86 Animation()->set_alternates_direction(alternates); |
| 87 } | 87 } |
| 88 | 88 |
| 89 scoped_ptr<cc::Animation> WebAnimationImpl::CloneToAnimation() { | 89 scoped_ptr<cc::Animation> WebAnimationImpl::PassAnimation() { |
| 90 scoped_ptr<cc::Animation> to_return( | 90 Animation()->set_needs_synchronized_start_time(true); |
| 91 animation_->Clone(cc::Animation::NonControllingInstance)); | 91 return animation_.Pass(); |
| 92 to_return->set_needs_synchronized_start_time(true); | |
| 93 return to_return.Pass(); | |
| 94 } | 92 } |
| 95 | 93 |
| 96 } // namespace webkit | 94 } // namespace webkit |
| OLD | NEW |