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 SkPipeFormat_DEFINED | 8 #ifndef SkPipeFormat_DEFINED |
9 #define SkPipeFormat_DEFINED | 9 #define SkPipeFormat_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 #define kDefinePicture_ExtPipeVerb SkSetFourByteTag('s', 'k', 'p', 'i') | 13 #define kDefinePicture_ExtPipeVerb SkSetFourByteTag('s', 'k', 'p', 'i') |
14 #define kDefineImage_ExtPipeVerb SkSetFourByteTag('s', 'k', 'i', 'm') | |
15 | 14 |
16 enum class SkPipeVerb : uint8_t { | 15 enum class SkPipeVerb : uint8_t { |
17 kSave, // extra == 0 | 16 kSave, // extra == 0 |
18 kSaveLayer, | 17 kSaveLayer, |
19 kRestore, // extra == 0 | 18 kRestore, // extra == 0 |
20 kConcat, // extra == SkMatrix::MaskType | 19 kConcat, // extra == SkMatrix::MaskType |
21 | 20 |
22 kClipRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 | 21 kClipRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 |
23 kClipRRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 | 22 kClipRRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 |
24 kClipPath, // extra == (SkRegion::Op << 1) | isAntiAlias:1 | 23 kClipPath, // extra == (SkRegion::Op << 1) | isAntiAlias:1 |
(...skipping 25 matching lines...) Expand all Loading... |
50 kDrawVertices, | 49 kDrawVertices, |
51 | 50 |
52 kDrawPicture, // extra == picture_index | 51 kDrawPicture, // extra == picture_index |
53 kDrawAnnotation, // extra == (key_len_plus_1:23 << 1) else next 32 | has_
data:1 | 52 kDrawAnnotation, // extra == (key_len_plus_1:23 << 1) else next 32 | has_
data:1 |
54 | 53 |
55 kDefineImage, // extra == image_index | 54 kDefineImage, // extra == image_index |
56 kDefineTypeface, | 55 kDefineTypeface, |
57 kDefineFactory, // extra == factory_index (followed by padded getTypeNam
e string) | 56 kDefineFactory, // extra == factory_index (followed by padded getTypeNam
e string) |
58 kDefinePicture, // extra == 0 or forget_index + 1 (0 means we're definin
g a new picture) | 57 kDefinePicture, // extra == 0 or forget_index + 1 (0 means we're definin
g a new picture) |
59 kEndPicture, // extra == picture_index | 58 kEndPicture, // extra == picture_index |
| 59 kWriteImage, // extra == image_index |
60 }; | 60 }; |
61 | 61 |
62 enum PaintUsage { | 62 enum PaintUsage { |
63 kText_PaintUsage = 1 << 0, | 63 kText_PaintUsage = 1 << 0, |
64 kTextBlob_PaintUsage = 1 << 1, | 64 kTextBlob_PaintUsage = 1 << 1, |
65 kGeometry_PaintUsage = 1 << 2, | 65 kGeometry_PaintUsage = 1 << 2, |
66 kImage_PaintUsage = 1 << 3, | 66 kImage_PaintUsage = 1 << 3, |
67 kSaveLayer_PaintUsage = 1 << 4, | 67 kSaveLayer_PaintUsage = 1 << 4, |
68 kDrawPaint_PaintUsage = 1 << 5, | 68 kDrawPaint_PaintUsage = 1 << 5, |
69 kVertices_PaintUsage = 1 << 6, | 69 kVertices_PaintUsage = 1 << 6, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 static inline SkPipeVerb unpack_verb(uint32_t data) { | 212 static inline SkPipeVerb unpack_verb(uint32_t data) { |
213 return (SkPipeVerb)(data >> 24); | 213 return (SkPipeVerb)(data >> 24); |
214 } | 214 } |
215 | 215 |
216 static inline unsigned unpack_verb_extra(uint32_t data) { | 216 static inline unsigned unpack_verb_extra(uint32_t data) { |
217 return data & 0xFFFFFF; | 217 return data & 0xFFFFFF; |
218 } | 218 } |
219 | 219 |
220 #endif | 220 #endif |
OLD | NEW |