Index: src/core/SkMathPriv.h |
diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h |
index b9184a0726934fdb801280014a7c7f30773b6d8d..6cca44e958295fbaf58f151ca0aefab4bc23f7f9 100644 |
--- a/src/core/SkMathPriv.h |
+++ b/src/core/SkMathPriv.h |
@@ -78,4 +78,8 @@ static inline unsigned SkDiv255Round(unsigned prod) { |
return (prod + (prod >> 8)) >> 8; |
} |
+static inline float SkPinToUnitFloat(float x) { |
+ return SkTMin(SkTMax(x, 0.0f), 1.0f); |
+} |
+ |
#endif |