Remove SkIsS16 and SkIsU16.
SkIsS16 can be replaced with SkTFitsIn<int16_t> and SkIsU16 is never
used.
Change-Id: I734f677149fab102cdb295a7b34faa3e3089134a
Reviewed-on: https://skia-review.googlesource.com/38600
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index a3819f4..a2668d9 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -10,6 +10,7 @@
#include "SkPoint.h"
#include "SkSize.h"
+#include "../private/SkTFitsIn.h"
struct SkRect;
@@ -116,8 +117,8 @@
}
bool is16Bit() const {
- return SkIsS16(fLeft) && SkIsS16(fTop) &&
- SkIsS16(fRight) && SkIsS16(fBottom);
+ return SkTFitsIn<int16_t>(fLeft) && SkTFitsIn<int16_t>(fTop) &&
+ SkTFitsIn<int16_t>(fRight) && SkTFitsIn<int16_t>(fBottom);
}
/** Set the rectangle to (0,0,0,0)
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 902858a..b453249 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -228,18 +228,6 @@
#define SK_MinU32 0
#define SK_NaN32 ((int) (1U << 31))
-/** Returns true if the value can be represented with signed 16bits
- */
-static inline bool SkIsS16(long x) {
- return (int16_t)x == x;
-}
-
-/** Returns true if the value can be represented with unsigned 16bits
- */
-static inline bool SkIsU16(long x) {
- return (uint16_t)x == x;
-}
-
static inline int32_t SkLeftShift(int32_t value, int32_t shift) {
return (int32_t) ((uint32_t) value << shift);
}