Index: include/core/SkColor.h |
diff --git a/include/core/SkColor.h b/include/core/SkColor.h |
index 1ba1331c1a7261f3faaba32002dc113ac9ed0397..008c16243f7ce743b5c0a3e8997857cb093d30d6 100644 |
--- a/include/core/SkColor.h |
+++ b/include/core/SkColor.h |
@@ -139,6 +139,16 @@ static inline SkColor SkHSVToColor(const SkScalar hsv[3]) |
return SkHSVToColor(0xFF, hsv); |
} |
+static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { |
reed1
2015/09/11 18:49:50
Does this need to be public?
robertphillips
2015/09/15 16:35:06
Done. Moved to SkColorPriv.h.
|
+ if (x < 0) { |
+ return 0; |
+ } |
+ if (x >= SK_Scalar1) { |
+ return 255; |
+ } |
+ return SkScalarToFixed(x) >> 8; |
+} |
+ |
//////////////////////////////////////////////////////////////////////// |
/** 32 bit ARGB color value, premultiplied. The byte order for this value is |