summaryrefslogtreecommitdiffstats
path: root/libs/hwui/utils
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-08-25 14:42:27 -0700
committerztenghui <ztenghui@google.com>2014-08-26 10:45:27 -0700
commit3bd3fa1f1d437e22aee35381a559dcee15a437dd (patch)
tree2a052bdfd2c2104570d5061effd1db189121e9f2 /libs/hwui/utils
parentf2a778683d602d9483bfaf8fdbc63e9fd19a7e5f (diff)
downloadframeworks_base-3bd3fa1f1d437e22aee35381a559dcee15a437dd.zip
frameworks_base-3bd3fa1f1d437e22aee35381a559dcee15a437dd.tar.gz
frameworks_base-3bd3fa1f1d437e22aee35381a559dcee15a437dd.tar.bz2
Correctly detect the wrong Z value for the light
b/17221975 Change-Id: I2b46da95ad12ca5260d7fe9514a75558b6b6393b
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r--libs/hwui/utils/MathUtils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/utils/MathUtils.h b/libs/hwui/utils/MathUtils.h
index 00448b8..d89859b 100644
--- a/libs/hwui/utils/MathUtils.h
+++ b/libs/hwui/utils/MathUtils.h
@@ -76,6 +76,11 @@ public:
return a < b ? a : b;
}
+ template<typename T>
+ static inline T clamp(T a, T minValue, T maxValue) {
+ return min(max(a, minValue), maxValue);
+ }
+
inline static float lerp(float v1, float v2, float t) {
return v1 + ((v2 - v1) * t);
}