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

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: Rebase and review changes 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
« no previous file with comments | « content/renderer/compositor_bindings/web_animation_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/renderer/compositor_bindings/web_animation_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698