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

Side by Side Diff: cc/base/time_util.h

Issue 2506093003: CC Animation: Make cc/animation an independent GN component. (Closed)
Patch Set: Rebase. Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/cc.gni » ('j') | 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 #ifndef CC_BASE_TIME_UTIL_H_ 5 #ifndef CC_BASE_TIME_UTIL_H_
6 #define CC_BASE_TIME_UTIL_H_ 6 #define CC_BASE_TIME_UTIL_H_
7 7
8 namespace base { 8 #include "base/time/time.h"
9 class TimeDelta;
10 }
11 9
12 namespace cc { 10 namespace cc {
13 11
14 class CC_EXPORT TimeUtil { 12 class TimeUtil {
15 public: 13 public:
16 static base::TimeDelta Scale(base::TimeDelta time_delta, double value) { 14 static base::TimeDelta Scale(base::TimeDelta time_delta, double value) {
17 return base::TimeDelta::FromInternalValue(static_cast<int64_t>( 15 return base::TimeDelta::FromInternalValue(static_cast<int64_t>(
18 static_cast<double>(time_delta.ToInternalValue()) * value)); 16 static_cast<double>(time_delta.ToInternalValue()) * value));
19 } 17 }
20 18
21 static double Divide(base::TimeDelta dividend, base::TimeDelta divisor) { 19 static double Divide(base::TimeDelta dividend, base::TimeDelta divisor) {
22 return static_cast<double>(dividend.ToInternalValue()) / 20 return static_cast<double>(dividend.ToInternalValue()) /
23 static_cast<double>(divisor.ToInternalValue()); 21 static_cast<double>(divisor.ToInternalValue());
24 } 22 }
25 23
26 static base::TimeDelta Mod(base::TimeDelta dividend, 24 static base::TimeDelta Mod(base::TimeDelta dividend,
27 base::TimeDelta divisor) { 25 base::TimeDelta divisor) {
28 return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() % 26 return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() %
29 divisor.ToInternalValue()); 27 divisor.ToInternalValue());
30 } 28 }
31 }; 29 };
32 30
33 } // namespace cc 31 } // namespace cc
34 32
35 #endif // CC_BASE_TIME_UTIL_H_ 33 #endif // CC_BASE_TIME_UTIL_H_
OLDNEW
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/cc.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698