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.
5 #ifndef CONTENT_BROWSER_ANDROID_ANIMATION_UTILS_H_
6 #define CONTENT_BROWSER_ANDROID_ANIMATION_UTILS_H_
11 T
Lerp(T a
, T b
, T t
) {
12 return a
+ (b
- a
) * t
;
16 T
Clamp(T value
, T low
, T high
) {
17 return value
< low
? low
: (value
> high
? high
: value
);
21 T
Damp(T input
, T factor
) {
24 result
= 1 - (1 - input
) * (1 - input
);
26 result
= 1 - std::pow(1 - input
, 2 * factor
);
31 } // namespace content
33 #endif // CONTENT_BROWSER_ANDROID_ANIMATION_UTILS_H_