| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef SkPictureFlat_DEFINED | 7 #ifndef SkPictureFlat_DEFINED |
| 8 #define SkPictureFlat_DEFINED | 8 #define SkPictureFlat_DEFINED |
| 9 | 9 |
| 10 | 10 |
| 11 #include "SkChecksum.h" | 11 #include "SkChecksum.h" |
| 12 #include "SkChunkAlloc.h" | 12 #include "SkChunkAlloc.h" |
| 13 #include "SkReadBuffer.h" | 13 #include "SkReadBuffer.h" |
| 14 #include "SkWriteBuffer.h" | 14 #include "SkWriteBuffer.h" |
| 15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 16 #include "SkPicture.h" | 16 #include "SkPicture.h" |
| 17 #include "SkPtrRecorder.h" | 17 #include "SkPtrRecorder.h" |
| 18 #include "SkTDynamicHash.h" | 18 #include "SkTDynamicHash.h" |
| 19 | 19 |
| 20 /* | |
| 21 * Note: While adding new DrawTypes, it is necessary to add to the end of this l
ist | |
| 22 * and update LAST_DRAWTYPE_ENUM to avoid having the code read older skps
wrong. | |
| 23 * (which can cause segfaults) | |
| 24 * | |
| 25 * Reordering can be done during version updates. | |
| 26 */ | |
| 27 enum DrawType { | 20 enum DrawType { |
| 28 UNUSED, | 21 UNUSED, |
| 29 CLIP_PATH, | 22 CLIP_PATH, |
| 30 CLIP_REGION, | 23 CLIP_REGION, |
| 31 CLIP_RECT, | 24 CLIP_RECT, |
| 32 CLIP_RRECT, | 25 CLIP_RRECT, |
| 33 CONCAT, | 26 CONCAT, |
| 34 DRAW_BITMAP, | 27 DRAW_BITMAP, |
| 35 DRAW_BITMAP_MATRIX, // deprecated, M41 was last Chromium version to write th
is to an .skp | 28 DRAW_BITMAP_MATRIX, // deprecated, M41 was last Chromium version to write th
is to an .skp |
| 36 DRAW_BITMAP_NINE, | 29 DRAW_BITMAP_NINE, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016, | 76 SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016, |
| 84 SAVE_LAYER_SAVELAYERREC, | 77 SAVE_LAYER_SAVELAYERREC, |
| 85 | 78 |
| 86 DRAW_ANNOTATION, | 79 DRAW_ANNOTATION, |
| 87 DRAW_DRAWABLE, | 80 DRAW_DRAWABLE, |
| 88 DRAW_DRAWABLE_MATRIX, | 81 DRAW_DRAWABLE_MATRIX, |
| 89 DRAW_TEXT_RSXFORM, | 82 DRAW_TEXT_RSXFORM, |
| 90 | 83 |
| 91 TRANSLATE_Z, | 84 TRANSLATE_Z, |
| 92 | 85 |
| 93 DRAW_SHADOWED_PICTURE_LIGHTS, | 86 LAST_DRAWTYPE_ENUM = TRANSLATE_Z |
| 94 | |
| 95 LAST_DRAWTYPE_ENUM = DRAW_SHADOWED_PICTURE_LIGHTS | |
| 96 }; | 87 }; |
| 97 | 88 |
| 98 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* | 89 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* |
| 99 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; | 90 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; |
| 100 | 91 |
| 101 enum DrawVertexFlags { | 92 enum DrawVertexFlags { |
| 102 DRAW_VERTICES_HAS_TEXS = 0x01, | 93 DRAW_VERTICES_HAS_TEXS = 0x01, |
| 103 DRAW_VERTICES_HAS_COLORS = 0x02, | 94 DRAW_VERTICES_HAS_COLORS = 0x02, |
| 104 DRAW_VERTICES_HAS_INDICES = 0x04, | 95 DRAW_VERTICES_HAS_INDICES = 0x04, |
| 105 DRAW_VERTICES_HAS_XFER = 0x08, | 96 DRAW_VERTICES_HAS_XFER = 0x08, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 void setupBuffer(SkReadBuffer& buffer) const { | 163 void setupBuffer(SkReadBuffer& buffer) const { |
| 173 buffer.setFactoryPlayback(fArray, fCount); | 164 buffer.setFactoryPlayback(fArray, fCount); |
| 174 } | 165 } |
| 175 | 166 |
| 176 private: | 167 private: |
| 177 int fCount; | 168 int fCount; |
| 178 SkFlattenable::Factory* fArray; | 169 SkFlattenable::Factory* fArray; |
| 179 }; | 170 }; |
| 180 | 171 |
| 181 #endif | 172 #endif |
| OLD | NEW |