diff options
author | Hal Canary <halcanary@google.com> | 2018-06-13 09:59:02 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-14 14:55:17 +0000 |
commit | c640d0dc96924699fdbb1a3cbdc907aa07b1cb3c (patch) | |
tree | d8973c4700da0bbe95c73bb3bc0c7d8f4589186d /include/core/SkTypes.h | |
parent | 4d4665436e540bd2ca393c139cbaff1eabd62ee2 (diff) |
Revert "Revert "SkTypes: extract SkTo""
This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876.
> Original change's description:
> > SkTypes: extract SkTo
> >
> > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> > Reviewed-on: https://skia-review.googlesource.com/133620
> > Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa
Reviewed-on: https://skia-review.googlesource.com/134506
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'include/core/SkTypes.h')
-rw-r--r-- | include/core/SkTypes.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 2fe28fc6ce..e624d4518c 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -96,21 +96,6 @@ typedef int S16CPU; */ typedef unsigned U16CPU; -#include "../private/SkTFitsIn.h" -template <typename D, typename S> constexpr D SkTo(S s) { - return SkASSERT(SkTFitsIn<D>(s)), - static_cast<D>(s); -} -#define SkToS8(x) SkTo<int8_t>(x) -#define SkToU8(x) SkTo<uint8_t>(x) -#define SkToS16(x) SkTo<int16_t>(x) -#define SkToU16(x) SkTo<uint16_t>(x) -#define SkToS32(x) SkTo<int32_t>(x) -#define SkToU32(x) SkTo<uint32_t>(x) -#define SkToInt(x) SkTo<int>(x) -#define SkToUInt(x) SkTo<unsigned>(x) -#define SkToSizeT(x) SkTo<size_t>(x) - /** Returns 0 or 1 based on the condition */ #define SkToBool(cond) ((cond) != 0) |