Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: src/core/SkValue.h

Issue 1585813004: SkValue: SkXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-01-14 (Thursday) 16:27:56 EST Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 SkValue { 14 class SkValue {
15 public: 15 public:
16 enum Type : uint32_t { 16 enum Type : uint32_t {
17 // 0-255 are reserved for built-in SkValue types. 17 // 0-255 are reserved for built-in SkValue types.
18 Null, 18 Null,
19 Byte , S16 , U16 , S32 , U32 , S64 , U64 , F32 , F64 , 19 Byte , S16 , U16 , S32 , U32 , S64 , U64 , F32 , F64 ,
20 Bytes, S16s, U16s, S32s, U32s, S64s, U64s, F32s, F64s, 20 Bytes, S16s, U16s, S32s, U32s, S64s, U64s, F32s, F64s,
21 Array, 21 Array,
22 22
23 // 256-2147483647 may be used by Skia for public Object types. 23 // 256-2147483647 may be used by Skia for public Object types.
24 24
25 ArithmeticXfermode = 0x100,
26 LerpXfermode,
27 OverdrawXfermode,
28 PixelXorXfermode,
29 ProcCoeffXfermode,
25 30
26 // 2147483648+ won't be used by Skia. They're open for client-specific use, testing, etc. 31 // 2147483648+ won't be used by Skia. They're open for client-specific use, testing, etc.
27 }; 32 };
28 33
29 enum Key : uint32_t { 34 typedef uint32_t Key;
30 // Each Object type may define its own namespace of Key values, 35 // Each Object type may define its own namespace of Key values,
mtklein 2016/01/14 22:58:28 Move this left and over the typedef, and update to
hal.canary 2016/01/14 23:43:10 done
31 // so there are no pre-defined Keys here. 36 // so there are no pre-defined Keys here.
32 // 37 //
33 // This is just a reminder that they must fit in a uint32_t, 38 // This is just a reminder that they must fit in a uint32_t,
34 // and that their namespace is distinct from other uint32_ts (e.g. Type) . 39 // and that their namespace is distinct from other uint32_ts (e.g. Type) .
35 };
36
37 SkValue(); 40 SkValue();
38 SkValue(const SkValue&); 41 SkValue(const SkValue&);
39 SkValue(SkValue&&); 42 SkValue(SkValue&&);
40 43
41 SkValue& operator=(const SkValue&); 44 SkValue& operator=(const SkValue&);
42 SkValue& operator=(SkValue&&); 45 SkValue& operator=(SkValue&&);
43 46
44 ~SkValue(); 47 ~SkValue();
45 48
46 static SkValue FromS32(int32_t); 49 static SkValue FromS32(int32_t);
(...skipping 25 matching lines...) Expand all
72 union { 75 union {
73 int32_t fS32; 76 int32_t fS32;
74 uint32_t fU32; 77 uint32_t fU32;
75 float fF32; 78 float fF32;
76 class Bytes* fBytes; 79 class Bytes* fBytes;
77 class Object* fObject; 80 class Object* fObject;
78 }; 81 };
79 }; 82 };
80 83
81 #endif//SkValue_DEFINED 84 #endif//SkValue_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698