aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkTo.h
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-06-13 09:42:32 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-13 13:45:47 +0000
commitfdcfb8b7c23fbf18f872d2c31d27978235033876 (patch)
tree3e3ad1c6ffe8647f45b08a560ab99384437dc2ba /include/private/SkTo.h
parentbb9ee9b4aa7d80e8a85832a462a3123060d4bd64 (diff)
Revert "SkTypes: extract SkTo"
This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. 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> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'include/private/SkTo.h')
-rw-r--r--include/private/SkTo.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/include/private/SkTo.h b/include/private/SkTo.h
deleted file mode 100644
index 9b5b7fd164..0000000000
--- a/include/private/SkTo.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2018 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef SkTo_DEFINED
-#define SkTo_DEFINED
-
-#include "SkTypes.h"
-#include "SkTFitsIn.h"
-
-template <typename D, typename S> constexpr D SkTo(S s) {
- return SkASSERT(SkTFitsIn<D>(s)),
- static_cast<D>(s);
-}
-
-template <typename S> constexpr int8_t SkToS8(S x) { return SkTo<int8_t>(x); }
-template <typename S> constexpr uint8_t SkToU8(S x) { return SkTo<uint8_t>(x); }
-template <typename S> constexpr int16_t SkToS16(S x) { return SkTo<int16_t>(x); }
-template <typename S> constexpr uint16_t SkToU16(S x) { return SkTo<uint16_t>(x); }
-template <typename S> constexpr int32_t SkToS32(S x) { return SkTo<int32_t>(x); }
-template <typename S> constexpr uint32_t SkToU32(S x) { return SkTo<uint32_t>(x); }
-template <typename S> constexpr int SkToInt(S x) { return SkTo<int>(x); }
-template <typename S> constexpr unsigned SkToUInt(S x) { return SkTo<unsigned>(x); }
-template <typename S> constexpr size_t SkToSizeT(S x) { return SkTo<size_t>(x); }
-
-#endif // SkTo_DEFINED