Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
diff --git a/libs/hwui/utils/MathUtils.h b/libs/hwui/utils/MathUtils.h
index 8d20f21..5475898 100644
--- a/libs/hwui/utils/MathUtils.h
+++ b/libs/hwui/utils/MathUtils.h
@@ -16,8 +16,8 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
-#include <algorithm>
#include <math.h>
+#include <algorithm>
namespace android {
namespace uirenderer {
@@ -34,9 +34,7 @@
return (value >= -NON_ZERO_EPSILON) && (value <= NON_ZERO_EPSILON);
}
- inline static bool isPositive(float value) {
- return value >= NON_ZERO_EPSILON;
- }
+ inline static bool isPositive(float value) { return value >= NON_ZERO_EPSILON; }
/**
* Clamps alpha value, and snaps when very near 0 or 1
@@ -69,28 +67,24 @@
* Returns the number of points (beyond two, the start and end) needed to form a polygonal
* approximation of an arc, with a given threshold value.
*/
- inline static int divisionsNeededToApproximateArc(float radius,
- float angleInRads, float threshold) {
+ inline static int divisionsNeededToApproximateArc(float radius, float angleInRads,
+ float threshold) {
const float errConst = (-threshold / radius + 1);
const float targetCosVal = 2 * errConst * errConst - 1;
// needed divisions are rounded up from approximation
- return (int)(ceilf(angleInRads / acos(targetCosVal)/2)) * 2;
+ return (int)(ceilf(angleInRads / acos(targetCosVal) / 2)) * 2;
}
- inline static bool areEqual(float valueA, float valueB) {
- return isZero(valueA - valueB);
- }
+ inline static bool areEqual(float valueA, float valueB) { return isZero(valueA - valueB); }
- template<typename T>
+ template <typename T>
static inline T clamp(T a, T minValue, T maxValue) {
return std::min(std::max(a, minValue), maxValue);
}
- inline static float lerp(float v1, float v2, float t) {
- return v1 + ((v2 - v1) * t);
- }
-}; // class MathUtils
+ inline static float lerp(float v1, float v2, float t) { return v1 + ((v2 - v1) * t); }
+}; // class MathUtils
} /* namespace uirenderer */
} /* namespace android */