| 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 "content/renderer/compositor_bindings/web_animation_impl.h" | 5 #include "content/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 "content/renderer/compositor_bindings/web_filter_animation_curve_impl.h
" | 10 #include "content/renderer/compositor_bindings/web_filter_animation_curve_impl.h
" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 int WebAnimationImpl::id() { | 72 int WebAnimationImpl::id() { |
| 73 return animation_->id(); | 73 return animation_->id(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 blink::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { | 76 blink::WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { |
| 77 return static_cast<WebAnimationImpl::TargetProperty>( | 77 return static_cast<WebAnimationImpl::TargetProperty>( |
| 78 animation_->target_property()); | 78 animation_->target_property()); |
| 79 } | 79 } |
| 80 #if WEB_ANIMATION_SUPPORTS_FRACTIONAL_ITERATIONS |
| 81 double WebAnimationImpl::iterations() const { |
| 82 return animation_->iterations(); |
| 83 } |
| 80 | 84 |
| 85 void WebAnimationImpl::setIterations(double n) { |
| 86 animation_->set_iterations(n); |
| 87 } |
| 88 #else |
| 81 int WebAnimationImpl::iterations() const { | 89 int WebAnimationImpl::iterations() const { |
| 82 return animation_->iterations(); | 90 return animation_->iterations(); |
| 83 } | 91 } |
| 84 | 92 |
| 85 void WebAnimationImpl::setIterations(int n) { | 93 void WebAnimationImpl::setIterations(int n) { |
| 86 animation_->set_iterations(n); | 94 animation_->set_iterations(n); |
| 87 } | 95 } |
| 88 | 96 #endif |
| 89 double WebAnimationImpl::startTime() const { | 97 double WebAnimationImpl::startTime() const { |
| 90 return (animation_->start_time() - base::TimeTicks()).InSecondsF(); | 98 return (animation_->start_time() - base::TimeTicks()).InSecondsF(); |
| 91 } | 99 } |
| 92 | 100 |
| 93 void WebAnimationImpl::setStartTime(double monotonic_time) { | 101 void WebAnimationImpl::setStartTime(double monotonic_time) { |
| 94 animation_->set_start_time(base::TimeTicks::FromInternalValue( | 102 animation_->set_start_time(base::TimeTicks::FromInternalValue( |
| 95 monotonic_time * base::Time::kMicrosecondsPerSecond)); | 103 monotonic_time * base::Time::kMicrosecondsPerSecond)); |
| 96 } | 104 } |
| 97 | 105 |
| 98 double WebAnimationImpl::timeOffset() const { | 106 double WebAnimationImpl::timeOffset() const { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 157 } |
| 150 #endif | 158 #endif |
| 151 | 159 |
| 152 scoped_ptr<cc::Animation> WebAnimationImpl::PassAnimation() { | 160 scoped_ptr<cc::Animation> WebAnimationImpl::PassAnimation() { |
| 153 animation_->set_needs_synchronized_start_time(true); | 161 animation_->set_needs_synchronized_start_time(true); |
| 154 return animation_.Pass(); | 162 return animation_.Pass(); |
| 155 } | 163 } |
| 156 | 164 |
| 157 } // namespace content | 165 } // namespace content |
| 158 | 166 |
| OLD | NEW |