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

Unified Diff: cc/base/time_util.h

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
Index: cc/base/time_util.h
diff --git a/cc/base/time_util.h b/cc/base/time_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..6a7ee71291db0d1aa1ae7a967c604a224c7573e5
--- /dev/null
+++ b/cc/base/time_util.h
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_BASE_TIME_UTIL_H_
+#define CC_BASE_TIME_UTIL_H_
+
+namespace base {
+class TimeDelta;
+}
+
+namespace cc {
+
ajuma 2014/11/07 15:58:00 Please define a TimeUtil class and make these func
patro 2014/11/10 09:46:52 Done.
+static base::TimeDelta Scale(const base::TimeDelta time_delta, double value) {
ajuma 2014/11/07 15:58:00 I assume you meant "const base::TimeDelta&"? A Tim
patro 2014/11/10 09:46:52 Done.
+ return base::TimeDelta::FromInternalValue(static_cast<int64>(
+ static_cast<double>(time_delta.ToInternalValue()) * value));
+}
+
+static base::TimeDelta Mod(const base::TimeDelta dividend,
+ const base::TimeDelta divisor) {
ajuma 2014/11/07 15:58:00 Same comment as above, please remove the consts he
patro 2014/11/10 09:46:52 Done.
+ return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() %
+ divisor.ToInternalValue());
+}
+
+} // namespace cc
+
+#endif // CC_BASE_TIME_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698