| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkValue_DEFINED | 8 #ifndef SkValue_DEFINED |
| 9 #define SkValue_DEFINED | 9 #define SkValue_DEFINED |
| 10 | 10 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 #include <functional> | 12 #include <functional> |
| 13 | 13 |
| 14 class SkData; | 14 class SkData; |
| 15 | 15 |
| 16 class SkValue { | 16 class SkValue { |
| 17 public: | 17 public: |
| 18 enum Type : uint32_t { | 18 enum Type : uint32_t { |
| 19 // 0-255 are reserved for built-in SkValue types. | 19 // 0-255 are reserved for built-in SkValue types. |
| 20 Null, | 20 Null, |
| 21 Byte , S16 , U16 , S32 , U32 , S64 , U64 , F32 , F64 , | 21 Byte , S16 , U16 , S32 , U32 , S64 , U64 , F32 , F64 , |
| 22 Bytes, S16s, U16s, S32s, U32s, S64s, U64s, F32s, F64s, | 22 Bytes, S16s, U16s, S32s, U32s, S64s, U64s, F32s, F64s, |
| 23 Array, | 23 Array, |
| 24 | 24 |
| 25 kMaxBuiltin = 0xFF, | 25 kMaxBuiltin = 0xFF, |
| 26 // 256-2147483647 may be used by Skia for public Object types. | 26 // 256-2147483647 may be used by Skia for public Object types. |
| 27 | 27 |
| 28 Image, |
| 28 Matrix, | 29 Matrix, |
| 29 | 30 |
| 30 ArithmeticXfermode, | 31 ArithmeticXfermode, |
| 31 DefaultXfermode, | 32 DefaultXfermode, |
| 32 LerpXfermode, | 33 LerpXfermode, |
| 33 PixelXorXfermode, | 34 PixelXorXfermode, |
| 34 ProcCoeffXfermode, | 35 ProcCoeffXfermode, |
| 35 | 36 |
| 36 kMaxPublicObject = 0x7FFFFFFF, | 37 kMaxPublicObject = 0x7FFFFFFF, |
| 37 // 2147483648+ won't be used by Skia. They're open for | 38 // 2147483648+ won't be used by Skia. They're open for |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 || U16s == fType | 109 || U16s == fType |
| 109 || U32s == fType | 110 || U32s == fType |
| 110 || F32s == fType; | 111 || F32s == fType; |
| 111 } | 112 } |
| 112 template <typename T> static SkValue FromT(SkValue::Type, T SkValue::*, T); | 113 template <typename T> static SkValue FromT(SkValue::Type, T SkValue::*, T); |
| 113 template <typename T> static SkValue FromTs(SkValue::Type, SkData*); | 114 template <typename T> static SkValue FromTs(SkValue::Type, SkData*); |
| 114 template <typename T> const T* asTs(SkValue::Type, int*) const; | 115 template <typename T> const T* asTs(SkValue::Type, int*) const; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 #endif // SkValue_DEFINED | 118 #endif // SkValue_DEFINED |
| OLD | NEW |