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

Unified Diff: include/core/SkTypes.h

Issue 1314583003: Replace SkPin32 with SkTPin and remove. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment. Created 5 years, 4 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 | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index c128e48fef94e2037c84fc4df846a11dca6a43a7..a5468f3090af865984fd3e627b22ad23fe61fc5d 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -392,13 +392,9 @@ static inline int32_t SkFastMin32(int32_t value, int32_t max) {
return value;
}
-template <typename T> static inline const T& SkTPin(const T& x, const T& min, const T& max) {
- return SkTMax(SkTMin(x, max), min);
-}
-
-/** Returns signed 32 bit value pinned between min and max, inclusively. */
-static inline int32_t SkPin32(int32_t value, int32_t min, int32_t max) {
- return SkTPin(value, min, max);
+/** Returns value pinned between min and max, inclusively. */
+template <typename T> static inline const T& SkTPin(const T& value, const T& min, const T& max) {
+ return SkTMax(SkTMin(value, max), min);
}
static inline uint32_t SkSetClearShift(uint32_t bits, bool cond,
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698