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

Side by Side Diff: src/pipe/SkPipeFormat.h

Issue 2335973003: change write-image to use pipeverbs like everyone else, and add test (Closed)
Patch Set: switch to [define_image] write_image Created 4 years, 3 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
« no previous file with comments | « src/pipe/SkPipeCanvas.cpp ('k') | src/pipe/SkPipeReader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « src/pipe/SkPipeCanvas.cpp ('k') | src/pipe/SkPipeReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698