Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: include/core/SkColor.h

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkColor.h
diff --git a/include/core/SkColor.h b/include/core/SkColor.h
index 1ba1331c1a7261f3faaba32002dc113ac9ed0397..441f47a6e301d84ad9b1644ad5dc4cd264cb349d 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 SkUnitScalarToByte(SkScalar x) {
+ if (x < 0) {
+ return 0;
+ }
+ if (x >= SK_Scalar1) {
+ return 255;
+ }
+ return SkScalarToFixed(x) >> 8;
bsalomon 2015/09/11 13:05:46 Maybe SkUnitScalarClampToByte(). Many of our SkXTo
robertphillips 2015/09/11 15:55:34 Done.
reed1 2015/09/11 18:47:11 Independent of the clamping question... This is a
robertphillips 2015/09/15 16:35:06 It seems like some pinned version of #2 would be b
+}
+
////////////////////////////////////////////////////////////////////////
/** 32 bit ARGB color value, premultiplied. The byte order for this value is

Powered by Google App Engine
This is Rietveld 408576698