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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_BASE_TIME_UTIL_H_
6 #define CC_BASE_TIME_UTIL_H_
7
8 namespace base {
9 class TimeDelta;
10 }
11
12 namespace cc {
13
14 base::TimeDelta operator*(const base::TimeDelta time_delta, double value) {
ajuma 2014/11/06 18:03:23 Rather than overloading operator* (which will be c
patro 2014/11/07 07:03:40 Done.
15 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() *
ajuma 2014/11/06 18:03:23 Make the double/int64 conversions explicit, e.g:
ajuma 2014/11/06 18:07:20 Sorry, messed up the parentheses there. I meant: b
patro 2014/11/07 07:03:40 Done.
16 value);
17 }
18
19 base::TimeDelta operator*(double value, const base::TimeDelta time_delta) {
20 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() *
21 value);
22 }
23
24 base::TimeDelta operator/(const base::TimeDelta time_delta, double value) {
25 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() /
26 value);
27 }
28
29 base::TimeDelta operator/(double value, const base::TimeDelta time_delta) {
30 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() /
31 value);
32 }
33
34 } // namespace cc
35
36 #endif // CC_BASE_TIME_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698