Chromium Code Reviews

Unified Diff: cc/base/time_util.h

Issue 719453007: Make Keyframe use TimeTicks/TimeDelta to represent time instead of double. (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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « cc/animation/scroll_offset_animation_curve_unittest.cc ('k') | cc/blink/web_filter_animation_curve_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/time_util.h
diff --git a/cc/base/time_util.h b/cc/base/time_util.h
index dc07e7489c204262c98dcb6d88a82b2ef0481b68..06682c27e2fc1efd08142e65d6b4545eea937961 100644
--- a/cc/base/time_util.h
+++ b/cc/base/time_util.h
@@ -18,6 +18,11 @@ class CC_EXPORT TimeUtil {
static_cast<double>(time_delta.ToInternalValue()) * value));
}
+ static double Divide(base::TimeDelta dividend, base::TimeDelta divisor) {
+ return static_cast<double>(dividend.ToInternalValue()) /
+ static_cast<double>(divisor.ToInternalValue());
+ }
+
static base::TimeDelta Mod(base::TimeDelta dividend,
base::TimeDelta divisor) {
return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() %
« no previous file with comments | « cc/animation/scroll_offset_animation_curve_unittest.cc ('k') | cc/blink/web_filter_animation_curve_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine