Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: content/renderer/compositor_bindings/web_animation_impl.cc

Issue 423373003: CC: Support fractional iteration count on compositor animations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor fixes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698