OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef SkPictureFlat_DEFINED | 8 #ifndef SkPictureFlat_DEFINED |
9 #define SkPictureFlat_DEFINED | 9 #define SkPictureFlat_DEFINED |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // new ops -- feel free to re-alphabetize on next version bump | 64 // new ops -- feel free to re-alphabetize on next version bump |
65 DRAW_DRRECT, | 65 DRAW_DRRECT, |
66 PUSH_CULL, // deprecated, M41 was last Chromium version to write this to an
.skp | 66 PUSH_CULL, // deprecated, M41 was last Chromium version to write this to an
.skp |
67 POP_CULL, // deprecated, M41 was last Chromium version to write this to an
.skp | 67 POP_CULL, // deprecated, M41 was last Chromium version to write this to an
.skp |
68 | 68 |
69 DRAW_PATCH, // could not add in aphabetical order | 69 DRAW_PATCH, // could not add in aphabetical order |
70 DRAW_PICTURE_MATRIX_PAINT, | 70 DRAW_PICTURE_MATRIX_PAINT, |
71 DRAW_TEXT_BLOB, | 71 DRAW_TEXT_BLOB, |
72 DRAW_IMAGE, | 72 DRAW_IMAGE, |
73 DRAW_IMAGE_RECT, | 73 DRAW_IMAGE_RECT, |
| 74 DRAW_ATLAS, |
74 | 75 |
75 LAST_DRAWTYPE_ENUM = DRAW_IMAGE_RECT | 76 LAST_DRAWTYPE_ENUM = DRAW_ATLAS |
76 }; | 77 }; |
77 | 78 |
78 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* | 79 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* |
79 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; | 80 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; |
80 | 81 |
81 enum DrawVertexFlags { | 82 enum DrawVertexFlags { |
82 DRAW_VERTICES_HAS_TEXS = 0x01, | 83 DRAW_VERTICES_HAS_TEXS = 0x01, |
83 DRAW_VERTICES_HAS_COLORS = 0x02, | 84 DRAW_VERTICES_HAS_COLORS = 0x02, |
84 DRAW_VERTICES_HAS_INDICES = 0x04, | 85 DRAW_VERTICES_HAS_INDICES = 0x04, |
85 DRAW_VERTICES_HAS_XFER = 0x08, | 86 DRAW_VERTICES_HAS_XFER = 0x08, |
86 }; | 87 }; |
87 | 88 |
| 89 enum DrawAtlasFlags { |
| 90 DRAW_ATLAS_HAS_COLORS = 1 << 0, |
| 91 DRAW_ATLAS_HAS_CULL = 1 << 1, |
| 92 }; |
| 93 |
88 /////////////////////////////////////////////////////////////////////////////// | 94 /////////////////////////////////////////////////////////////////////////////// |
89 // clipparams are packed in 5 bits | 95 // clipparams are packed in 5 bits |
90 // doAA:1 | regionOp:4 | 96 // doAA:1 | regionOp:4 |
91 | 97 |
92 static inline uint32_t ClipParams_pack(SkRegion::Op op, bool doAA) { | 98 static inline uint32_t ClipParams_pack(SkRegion::Op op, bool doAA) { |
93 unsigned doAABit = doAA ? 1 : 0; | 99 unsigned doAABit = doAA ? 1 : 0; |
94 return (doAABit << 4) | op; | 100 return (doAABit << 4) | op; |
95 } | 101 } |
96 | 102 |
97 static inline SkRegion::Op ClipParams_unpackRegionOp(uint32_t packed) { | 103 static inline SkRegion::Op ClipParams_unpackRegionOp(uint32_t packed) { |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 bool fReady; | 555 bool fReady; |
550 | 556 |
551 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! | 557 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! |
552 SkTDArray<const SkFlatData*> fIndexedData; | 558 SkTDArray<const SkFlatData*> fIndexedData; |
553 | 559 |
554 // For SkFlatData -> cached SkFlatData, which has index(). | 560 // For SkFlatData -> cached SkFlatData, which has index(). |
555 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; | 561 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; |
556 }; | 562 }; |
557 | 563 |
558 #endif | 564 #endif |
OLD | NEW |