summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-07-07 18:42:17 -0700
committer Chris Craik <ccraik@google.com> 2015-07-07 18:42:42 -0700
commite6a15ee3d0c78eb3f2551d73a7d238c3d8d2f075 (patch)
treefb4aa5c04487f1f2c13221937933288e2a3fff44 /libs/hwui/Properties.cpp
parent61d7acae0cafc265e94a35ad3ba1677f60346de9 (diff)
Remove all usage of fmin and fmax
bug:22208220 Removes needless call, and upconversion to doubles in multiple places. Change-Id: I1b949fa5f206446ac34de800154c0147d6bd8034
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r--libs/hwui/Properties.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index 7dbe3b78839c..2e63793f6ffe 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -17,7 +17,7 @@
#include "Debug.h"
-#include <cmath>
+#include <algorithm>
#include <cutils/log.h>
namespace android {
@@ -117,19 +117,19 @@ void Properties::overrideProperty(const char* name, const char* value) {
ALOGD("profile bars %s", sDisableProfileBars ? "disabled" : "enabled");
return;
} else if (!strcmp(name, "ambientRatio")) {
- overrideAmbientRatio = fmin(fmax(atof(value), 0.0), 10.0);
+ overrideAmbientRatio = std::min(std::max(atof(value), 0.0), 10.0);
ALOGD("ambientRatio = %.2f", overrideAmbientRatio);
return;
} else if (!strcmp(name, "lightRadius")) {
- overrideLightRadius = fmin(fmax(atof(value), 0.0), 3000.0);
+ overrideLightRadius = std::min(std::max(atof(value), 0.0), 3000.0);
ALOGD("lightRadius = %.2f", overrideLightRadius);
return;
} else if (!strcmp(name, "lightPosY")) {
- overrideLightPosY = fmin(fmax(atof(value), 0.0), 3000.0);
+ overrideLightPosY = std::min(std::max(atof(value), 0.0), 3000.0);
ALOGD("lightPos Y = %.2f", overrideLightPosY);
return;
} else if (!strcmp(name, "lightPosZ")) {
- overrideLightPosZ = fmin(fmax(atof(value), 0.0), 3000.0);
+ overrideLightPosZ = std::min(std::max(atof(value), 0.0), 3000.0);
ALOGD("lightPos Z = %.2f", overrideLightPosZ);
return;
} else if (!strcmp(name, "ambientShadowStrength")) {