| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_STRICT, // deprecated (M45) | 73 DRAW_IMAGE_RECT_STRICT, // deprecated (M45) |
| 74 DRAW_ATLAS, | 74 DRAW_ATLAS, |
| 75 DRAW_IMAGE_NINE, | 75 DRAW_IMAGE_NINE, |
| 76 DRAW_IMAGE_RECT, | 76 DRAW_IMAGE_RECT, |
| 77 | 77 |
| 78 SAVE_LAYER_SAVELAYERFLAGS, | 78 SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016, |
| 79 SAVE_LAYER_SAVELAYERREC, |
| 79 | 80 |
| 80 LAST_DRAWTYPE_ENUM = SAVE_LAYER_SAVELAYERFLAGS, | 81 LAST_DRAWTYPE_ENUM = SAVE_LAYER_SAVELAYERREC, |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* | 84 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* |
| 84 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; | 85 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; |
| 85 | 86 |
| 86 enum DrawVertexFlags { | 87 enum DrawVertexFlags { |
| 87 DRAW_VERTICES_HAS_TEXS = 0x01, | 88 DRAW_VERTICES_HAS_TEXS = 0x01, |
| 88 DRAW_VERTICES_HAS_COLORS = 0x02, | 89 DRAW_VERTICES_HAS_COLORS = 0x02, |
| 89 DRAW_VERTICES_HAS_INDICES = 0x04, | 90 DRAW_VERTICES_HAS_INDICES = 0x04, |
| 90 DRAW_VERTICES_HAS_XFER = 0x08, | 91 DRAW_VERTICES_HAS_XFER = 0x08, |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 enum DrawAtlasFlags { | 94 enum DrawAtlasFlags { |
| 94 DRAW_ATLAS_HAS_COLORS = 1 << 0, | 95 DRAW_ATLAS_HAS_COLORS = 1 << 0, |
| 95 DRAW_ATLAS_HAS_CULL = 1 << 1, | 96 DRAW_ATLAS_HAS_CULL = 1 << 1, |
| 96 }; | 97 }; |
| 97 | 98 |
| 99 enum SaveLayerRecFlatFlags { |
| 100 SAVELAYERREC_HAS_BOUNDS = 1 << 0, |
| 101 SAVELAYERREC_HAS_PAINT = 1 << 1, |
| 102 SAVELAYERREC_HAS_BACKDROP = 1 << 2, |
| 103 SAVELAYERREC_HAS_FLAGS = 1 << 3, |
| 104 }; |
| 105 |
| 98 /////////////////////////////////////////////////////////////////////////////// | 106 /////////////////////////////////////////////////////////////////////////////// |
| 99 // clipparams are packed in 5 bits | 107 // clipparams are packed in 5 bits |
| 100 // doAA:1 | regionOp:4 | 108 // doAA:1 | regionOp:4 |
| 101 | 109 |
| 102 static inline uint32_t ClipParams_pack(SkRegion::Op op, bool doAA) { | 110 static inline uint32_t ClipParams_pack(SkRegion::Op op, bool doAA) { |
| 103 unsigned doAABit = doAA ? 1 : 0; | 111 unsigned doAABit = doAA ? 1 : 0; |
| 104 return (doAABit << 4) | op; | 112 return (doAABit << 4) | op; |
| 105 } | 113 } |
| 106 | 114 |
| 107 static inline SkRegion::Op ClipParams_unpackRegionOp(uint32_t packed) { | 115 static inline SkRegion::Op ClipParams_unpackRegionOp(uint32_t packed) { |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 bool fReady; | 563 bool fReady; |
| 556 | 564 |
| 557 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! | 565 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! |
| 558 SkTDArray<const SkFlatData*> fIndexedData; | 566 SkTDArray<const SkFlatData*> fIndexedData; |
| 559 | 567 |
| 560 // For SkFlatData -> cached SkFlatData, which has index(). | 568 // For SkFlatData -> cached SkFlatData, which has index(). |
| 561 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; | 569 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; |
| 562 }; | 570 }; |
| 563 | 571 |
| 564 #endif | 572 #endif |
| OLD | NEW |