| 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         Matrix, |   28         Matrix, | 
|   29  |   29  | 
 |   30         ArithmeticXfermode, | 
 |   31         DefaultXfermode, | 
 |   32         LerpXfermode, | 
 |   33         PixelXorXfermode, | 
 |   34         ProcCoeffXfermode, | 
 |   35  | 
|   30         kMaxPublicObject = 0x7FFFFFFF, |   36         kMaxPublicObject = 0x7FFFFFFF, | 
|   31         // 2147483648+ won't be used by Skia.  They're open for |   37         // 2147483648+ won't be used by Skia.  They're open for | 
|   32         // client-specific use, testing, etc. |   38         // client-specific use, testing, etc. | 
|   33     }; |   39     }; | 
|   34  |   40  | 
|   35     // Each Object type may define its own namespace of Key values, |   41     // Each Object type may define its own namespace of Key values, | 
|   36     // so there are no pre-defined Keys here. |   42     // so there are no pre-defined Keys here. | 
|   37     // |   43     // | 
|   38     // This is just a reminder that they must fit in a uint32_t, |   44     // This is just a reminder that they must fit in a uint32_t, | 
|   39     // and that their namespace is distinct from other uint32_ts (e.g. Type). |   45     // and that their namespace is distinct from other uint32_ts (e.g. Type). | 
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  101         return Bytes == fType |  107         return Bytes == fType | 
|  102             || U16s == fType |  108             || U16s == fType | 
|  103             || U32s == fType |  109             || U32s == fType | 
|  104             || F32s == fType; |  110             || F32s == fType; | 
|  105     } |  111     } | 
|  106     template <typename T> static SkValue FromT(SkValue::Type, T SkValue::*, T); |  112     template <typename T> static SkValue FromT(SkValue::Type, T SkValue::*, T); | 
|  107     template <typename T> static SkValue FromTs(SkValue::Type, SkData*); |  113     template <typename T> static SkValue FromTs(SkValue::Type, SkData*); | 
|  108     template <typename T> const T* asTs(SkValue::Type, int*) const; |  114     template <typename T> const T* asTs(SkValue::Type, int*) const; | 
|  109 }; |  115 }; | 
|  110  |  116  | 
|  111 template <typename T> |  | 
|  112 SkValue SkToValue(const T&); |  | 
|  113  |  | 
|  114 template <typename T> |  | 
|  115 bool SkFromValue(const SkValue&, T*); |  | 
|  116  |  | 
|  117 #endif  // SkValue_DEFINED |  117 #endif  // SkValue_DEFINED | 
| OLD | NEW |