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