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

Unified Diff: src/effects/GrCircleBlurFragmentProcessor.cpp

Issue 1691403002: Change SkUnitScalarClampToByte to more accurate implementation. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rounding doesn't work well for GrCircleBlurFragmentProcessor. Created 4 years, 10 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
« include/core/SkColorPriv.h ('K') | « include/core/SkColorPriv.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/GrCircleBlurFragmentProcessor.cpp
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp
index f319e3d90fc1863805b44be9d784c1b07a1b478c..f5073a520ae98ff11881b16f3ff6f6804ee34578 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/effects/GrCircleBlurFragmentProcessor.cpp
@@ -175,7 +175,7 @@ static uint8_t eval_at(float t, float halfWidth, float* halfKernel, int kernelWH
}
}
- return SkUnitScalarClampToByte(acc);
+ return static_cast<uint8_t>(SkTPin(acc, 0.0f, 1.0f) * 255);
}
static inline void compute_profile_offset_and_size(float halfWH, float sigma,
« include/core/SkColorPriv.h ('K') | « include/core/SkColorPriv.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698