| 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 | 7 |
| 8 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
| 9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
| 10 | 10 |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkFlattenable.h" | 12 #include "SkFlattenable.h" |
| 13 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | |
| 14 #include "SkMatrixClipStateMgr.h" | |
| 15 #endif | |
| 16 #include "SkPathHeap.h" | 13 #include "SkPathHeap.h" |
| 17 #include "SkPicture.h" | 14 #include "SkPicture.h" |
| 18 #include "SkPictureData.h" | 15 #include "SkPictureData.h" |
| 19 #include "SkPictureFlat.h" | 16 #include "SkPictureFlat.h" |
| 20 #include "SkTemplates.h" | 17 #include "SkTemplates.h" |
| 21 #include "SkWriter32.h" | 18 #include "SkWriter32.h" |
| 22 | 19 |
| 23 class SkBBoxHierarchy; | 20 class SkBBoxHierarchy; |
| 24 class SkPictureStateTree; | 21 class SkPictureStateTree; |
| 25 | 22 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 110 } |
| 114 | 111 |
| 115 protected: | 112 protected: |
| 116 void addNoOp(); | 113 void addNoOp(); |
| 117 | 114 |
| 118 private: | 115 private: |
| 119 void handleOptimization(int opt); | 116 void handleOptimization(int opt); |
| 120 size_t recordRestoreOffsetPlaceholder(SkRegion::Op); | 117 size_t recordRestoreOffsetPlaceholder(SkRegion::Op); |
| 121 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse
t); | 118 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse
t); |
| 122 | 119 |
| 123 #ifndef SK_COLLAPSE_MATRIX_CLIP_STATE | |
| 124 SkTDArray<int32_t> fRestoreOffsetStack; | 120 SkTDArray<int32_t> fRestoreOffsetStack; |
| 125 int fFirstSavedLayerIndex; | 121 int fFirstSavedLayerIndex; |
| 126 enum { | 122 enum { |
| 127 kNoSavedLayerIndex = -1 | 123 kNoSavedLayerIndex = -1 |
| 128 }; | 124 }; |
| 129 #endif | |
| 130 | 125 |
| 131 SkTDArray<uint32_t> fCullOffsetStack; | 126 SkTDArray<uint32_t> fCullOffsetStack; |
| 132 | 127 |
| 133 /* | 128 /* |
| 134 * Write the 'drawType' operation and chunk size to the skp. 'size' | 129 * Write the 'drawType' operation and chunk size to the skp. 'size' |
| 135 * can potentially be increased if the chunk size needs its own storage | 130 * can potentially be increased if the chunk size needs its own storage |
| 136 * location (i.e., it overflows 24 bits). | 131 * location (i.e., it overflows 24 bits). |
| 137 * Returns the start offset of the chunk. This is the location at which | 132 * Returns the start offset of the chunk. This is the location at which |
| 138 * the opcode & size are stored. | 133 * the opcode & size are stored. |
| 139 * TODO: since we are handing the size into here we could call reserve | 134 * TODO: since we are handing the size into here we could call reserve |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // These are set to NULL in our constructor, but may be changed by | 298 // These are set to NULL in our constructor, but may be changed by |
| 304 // subclasses, in which case they will be SkSafeUnref'd in our destructor. | 299 // subclasses, in which case they will be SkSafeUnref'd in our destructor. |
| 305 SkBBoxHierarchy* fBoundingHierarchy; | 300 SkBBoxHierarchy* fBoundingHierarchy; |
| 306 SkPictureStateTree* fStateTree; | 301 SkPictureStateTree* fStateTree; |
| 307 | 302 |
| 308 // Allocated in the constructor and managed by this class. | 303 // Allocated in the constructor and managed by this class. |
| 309 SkBitmapHeap* fBitmapHeap; | 304 SkBitmapHeap* fBitmapHeap; |
| 310 | 305 |
| 311 private: | 306 private: |
| 312 friend class MatrixClipState; // for access to *Impl methods | 307 friend class MatrixClipState; // for access to *Impl methods |
| 313 friend class SkMatrixClipStateMgr; // for access to *Impl methods | |
| 314 | 308 |
| 315 SkPictureContentInfo fContentInfo; | 309 SkPictureContentInfo fContentInfo; |
| 316 SkAutoTUnref<SkPathHeap> fPathHeap; | 310 SkAutoTUnref<SkPathHeap> fPathHeap; |
| 317 | 311 |
| 318 SkChunkFlatController fFlattenableHeap; | 312 SkChunkFlatController fFlattenableHeap; |
| 319 | 313 |
| 320 SkPaintDictionary fPaints; | 314 SkPaintDictionary fPaints; |
| 321 | 315 |
| 322 SkWriter32 fWriter; | 316 SkWriter32 fWriter; |
| 323 | 317 |
| 324 // we ref each item in these arrays | 318 // we ref each item in these arrays |
| 325 SkTDArray<const SkPicture*> fPictureRefs; | 319 SkTDArray<const SkPicture*> fPictureRefs; |
| 326 | 320 |
| 327 uint32_t fRecordFlags; | 321 uint32_t fRecordFlags; |
| 328 bool fOptsEnabled; | 322 bool fOptsEnabled; |
| 329 int fInitialSaveCount; | 323 int fInitialSaveCount; |
| 330 | 324 |
| 331 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor | 325 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor |
| 332 friend class SkPictureTester; // for unit testing | 326 friend class SkPictureTester; // for unit testing |
| 333 | 327 |
| 334 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | |
| 335 SkMatrixClipStateMgr fMCMgr; | |
| 336 #endif | |
| 337 | |
| 338 typedef SkCanvas INHERITED; | 328 typedef SkCanvas INHERITED; |
| 339 }; | 329 }; |
| 340 | 330 |
| 341 #endif | 331 #endif |
| OLD | NEW |