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

Unified Diff: cc/test/animation_test_common.cc

Issue 693883004: Make cc::animation::TrimTimeToCurrentIteration,cc::AnimationCurve::Duration use TimeTicks/TimeDelta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/animation_test_common.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/animation_test_common.cc
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc
index 5ab8942ccc18a182a9f8a3b62146f41d83a94a3f..fba316669fdde60797c2f3d81d3858cf89f4f5df 100644
--- a/cc/test/animation_test_common.cc
+++ b/cc/test/animation_test_common.cc
@@ -124,14 +124,16 @@ int AddAnimatedFilter(Target* target,
}
FakeFloatAnimationCurve::FakeFloatAnimationCurve()
- : duration_(1.0) {}
+ : duration_(base::TimeDelta::FromSecondsD(1.0)) {
+}
FakeFloatAnimationCurve::FakeFloatAnimationCurve(double duration)
- : duration_(duration) {}
+ : duration_(base::TimeDelta::FromSecondsD(duration)) {
+}
FakeFloatAnimationCurve::~FakeFloatAnimationCurve() {}
-double FakeFloatAnimationCurve::Duration() const {
+base::TimeDelta FakeFloatAnimationCurve::Duration() const {
return duration_;
}
@@ -144,11 +146,12 @@ scoped_ptr<AnimationCurve> FakeFloatAnimationCurve::Clone() const {
}
FakeTransformTransition::FakeTransformTransition(double duration)
- : duration_(duration) {}
+ : duration_(base::TimeDelta::FromSecondsD(duration)) {
+}
FakeTransformTransition::~FakeTransformTransition() {}
-double FakeTransformTransition::Duration() const {
+base::TimeDelta FakeTransformTransition::Duration() const {
return duration_;
}
@@ -175,18 +178,18 @@ scoped_ptr<AnimationCurve> FakeTransformTransition::Clone() const {
return make_scoped_ptr(new FakeTransformTransition(*this));
}
-
FakeFloatTransition::FakeFloatTransition(double duration, float from, float to)
- : duration_(duration), from_(from), to_(to) {}
+ : duration_(base::TimeDelta::FromSecondsD(duration)), from_(from), to_(to) {
+}
FakeFloatTransition::~FakeFloatTransition() {}
-double FakeFloatTransition::Duration() const {
+base::TimeDelta FakeFloatTransition::Duration() const {
return duration_;
}
float FakeFloatTransition::GetValue(double time) const {
- time /= duration_;
+ time /= duration_.InSecondsF();
if (time >= 1.0)
time = 1.0;
return (1.0 - time) * from_ + time * to_;
« no previous file with comments | « cc/test/animation_test_common.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698