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

Unified Diff: src/core/SkColor.cpp

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no-GPU build 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
« no previous file with comments | « include/core/SkScalar.h ('k') | src/core/SkMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColor.cpp
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index 73e6ddd8747ea2da6d1e1fad17ce0025ddb2874c..a21f0192398f95ba3c4256a41c0d2ff47da4ed64 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -70,21 +70,11 @@ void SkRGBToHSV(U8CPU r, U8CPU g, U8CPU b, SkScalar hsv[3]) {
hsv[2] = v;
}
-static inline U8CPU UnitScalarToByte(SkScalar x) {
- if (x < 0) {
- return 0;
- }
- if (x >= SK_Scalar1) {
- return 255;
- }
- return SkScalarToFixed(x) >> 8;
-}
-
SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
SkASSERT(hsv);
- U8CPU s = UnitScalarToByte(hsv[1]);
- U8CPU v = UnitScalarToByte(hsv[2]);
+ U8CPU s = SkUnitScalarClampToByte(hsv[1]);
+ U8CPU v = SkUnitScalarClampToByte(hsv[2]);
if (0 == s) { // shade of gray
return SkColorSetARGB(a, v, v, v);
« no previous file with comments | « include/core/SkScalar.h ('k') | src/core/SkMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698