diff options
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/SkFixed.h | 4 | ||||
-rw-r--r-- | include/private/SkPathRef.h | 7 | ||||
-rw-r--r-- | include/private/SkTDArray.h | 4 | ||||
-rw-r--r-- | include/private/SkTo.h | 28 |
4 files changed, 7 insertions, 36 deletions
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h index 0d15e02aa9..15062f55b3 100644 --- a/include/private/SkFixed.h +++ b/include/private/SkFixed.h @@ -8,9 +8,9 @@ #ifndef SkFixed_DEFINED #define SkFixed_DEFINED -#include "SkSafe_math.h" #include "SkScalar.h" -#include "SkTo.h" +#include "SkSafe_math.h" + #include "SkTypes.h" /** \file SkFixed.h diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h index 5a5a04118c..5f64f1ae07 100644 --- a/include/private/SkPathRef.h +++ b/include/private/SkPathRef.h @@ -1,3 +1,4 @@ + /* * Copyright 2012 Google Inc. * @@ -8,16 +9,14 @@ #ifndef SkPathRef_DEFINED #define SkPathRef_DEFINED -#include "SkAtomics.h" +#include "../private/SkAtomics.h" +#include "../private/SkTDArray.h" #include "SkMatrix.h" #include "SkPoint.h" #include "SkRRect.h" #include "SkRect.h" #include "SkRefCnt.h" -#include "SkTDArray.h" #include "SkTemplates.h" -#include "SkTo.h" - #include <limits> class SkRBuffer; diff --git a/include/private/SkTDArray.h b/include/private/SkTDArray.h index dd3212d0dd..b030dc5627 100644 --- a/include/private/SkTDArray.h +++ b/include/private/SkTDArray.h @@ -1,3 +1,4 @@ + /* * Copyright 2006 The Android Open Source Project * @@ -9,9 +10,8 @@ #ifndef SkTDArray_DEFINED #define SkTDArray_DEFINED -#include "SkMalloc.h" -#include "SkTo.h" #include "SkTypes.h" +#include "SkMalloc.h" template <typename T> class SkTDArray { public: 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 |