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

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

Issue 226543005: CC should use TimeTicks and TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 animation_->target_property()); 77 animation_->target_property());
78 } 78 }
79 79
80 int WebAnimationImpl::iterations() const { return animation_->iterations(); } 80 int WebAnimationImpl::iterations() const { return animation_->iterations(); }
81 81
82 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); } 82 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); }
83 83
84 double WebAnimationImpl::startTime() const { return animation_->start_time(); } 84 double WebAnimationImpl::startTime() const { return animation_->start_time(); }
85 85
86 void WebAnimationImpl::setStartTime(double monotonic_time) { 86 void WebAnimationImpl::setStartTime(double monotonic_time) {
87 animation_->set_start_time(monotonic_time); 87 animation_->set_start_time(base::TimeTicks::FromInternalValue(
88 monotonic_time * base::Time::kMicrosecondsPerSecond));
88 } 89 }
89 90
90 double WebAnimationImpl::timeOffset() const { 91 double WebAnimationImpl::timeOffset() const {
91 return animation_->time_offset(); 92 return animation_->time_offset();
92 } 93 }
93 94
94 void WebAnimationImpl::setTimeOffset(double monotonic_time) { 95 void WebAnimationImpl::setTimeOffset(double monotonic_time) {
95 animation_->set_time_offset(monotonic_time); 96 animation_->set_time_offset(base::TimeTicks::FromInternalValue(
97 monotonic_time * base::Time::kMicrosecondsPerSecond));
96 } 98 }
97 99
98 bool WebAnimationImpl::alternatesDirection() const { 100 bool WebAnimationImpl::alternatesDirection() const {
99 return animation_->alternates_direction(); 101 return animation_->alternates_direction();
100 } 102 }
101 103
102 void WebAnimationImpl::setAlternatesDirection(bool alternates) { 104 void WebAnimationImpl::setAlternatesDirection(bool alternates) {
103 animation_->set_alternates_direction(alternates); 105 animation_->set_alternates_direction(alternates);
104 } 106 }
105 107
(...skipping 11 matching lines...) Expand all
117 COMPILE_ASSERT_MATCHING_ENUMS( 119 COMPILE_ASSERT_MATCHING_ENUMS(
118 WebAnimation::TargetPropertyOpacity, Animation::Opacity); 120 WebAnimation::TargetPropertyOpacity, Animation::Opacity);
119 COMPILE_ASSERT_MATCHING_ENUMS( 121 COMPILE_ASSERT_MATCHING_ENUMS(
120 WebAnimation::TargetPropertyFilter, Animation::Filter); 122 WebAnimation::TargetPropertyFilter, Animation::Filter);
121 #if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED 123 #if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED
122 COMPILE_ASSERT_MATCHING_ENUMS( 124 COMPILE_ASSERT_MATCHING_ENUMS(
123 WebAnimation::TargetPropertyScrollOffset, Animation::ScrollOffset); 125 WebAnimation::TargetPropertyScrollOffset, Animation::ScrollOffset);
124 #endif 126 #endif
125 127
126 } // namespace webkit 128 } // namespace webkit
OLDNEW
« cc/input/page_scale_animation.h ('K') | « ui/compositor/layer_animator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698