Chromium Code Reviews| 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 skg's wrong. | |
|
jvanverth1
2016/07/15 19:16:30
Spelling nit: skps
| |
| 23 * (which can cause segfaults) | |
| 24 * | |
| 25 * Reordering can be done during version updates. | |
| 26 */ | |
| 20 enum DrawType { | 27 enum DrawType { |
| 21 UNUSED, | 28 UNUSED, |
| 22 CLIP_PATH, | 29 CLIP_PATH, |
| 23 CLIP_REGION, | 30 CLIP_REGION, |
| 24 CLIP_RECT, | 31 CLIP_RECT, |
| 25 CLIP_RRECT, | 32 CLIP_RRECT, |
| 26 CONCAT, | 33 CONCAT, |
| 27 DRAW_BITMAP, | 34 DRAW_BITMAP, |
| 28 DRAW_BITMAP_MATRIX, // deprecated, M41 was last Chromium version to write th is to an .skp | 35 DRAW_BITMAP_MATRIX, // deprecated, M41 was last Chromium version to write th is to an .skp |
| 29 DRAW_BITMAP_NINE, | 36 DRAW_BITMAP_NINE, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016, | 83 SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016, |
| 77 SAVE_LAYER_SAVELAYERREC, | 84 SAVE_LAYER_SAVELAYERREC, |
| 78 | 85 |
| 79 DRAW_ANNOTATION, | 86 DRAW_ANNOTATION, |
| 80 DRAW_DRAWABLE, | 87 DRAW_DRAWABLE, |
| 81 DRAW_DRAWABLE_MATRIX, | 88 DRAW_DRAWABLE_MATRIX, |
| 82 DRAW_TEXT_RSXFORM, | 89 DRAW_TEXT_RSXFORM, |
| 83 | 90 |
| 84 TRANSLATE_Z, | 91 TRANSLATE_Z, |
| 85 | 92 |
| 86 LAST_DRAWTYPE_ENUM = TRANSLATE_Z | 93 DRAW_SHADOWED_PICTURE_LIGHTS, |
| 94 | |
| 95 LAST_DRAWTYPE_ENUM = DRAW_SHADOWED_PICTURE_LIGHTS | |
| 87 }; | 96 }; |
| 88 | 97 |
| 89 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* | 98 // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* |
| 90 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; | 99 static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1; |
| 91 | 100 |
| 92 enum DrawVertexFlags { | 101 enum DrawVertexFlags { |
| 93 DRAW_VERTICES_HAS_TEXS = 0x01, | 102 DRAW_VERTICES_HAS_TEXS = 0x01, |
| 94 DRAW_VERTICES_HAS_COLORS = 0x02, | 103 DRAW_VERTICES_HAS_COLORS = 0x02, |
| 95 DRAW_VERTICES_HAS_INDICES = 0x04, | 104 DRAW_VERTICES_HAS_INDICES = 0x04, |
| 96 DRAW_VERTICES_HAS_XFER = 0x08, | 105 DRAW_VERTICES_HAS_XFER = 0x08, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 void setupBuffer(SkReadBuffer& buffer) const { | 172 void setupBuffer(SkReadBuffer& buffer) const { |
| 164 buffer.setFactoryPlayback(fArray, fCount); | 173 buffer.setFactoryPlayback(fArray, fCount); |
| 165 } | 174 } |
| 166 | 175 |
| 167 private: | 176 private: |
| 168 int fCount; | 177 int fCount; |
| 169 SkFlattenable::Factory* fArray; | 178 SkFlattenable::Factory* fArray; |
| 170 }; | 179 }; |
| 171 | 180 |
| 172 #endif | 181 #endif |
| OLD | NEW |