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 #include "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" |
10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 fFlattenableHeap(HEAP_BLOCK_SIZE), | 34 fFlattenableHeap(HEAP_BLOCK_SIZE), |
35 fMatrices(&fFlattenableHeap), | 35 fMatrices(&fFlattenableHeap), |
36 fPaints(&fFlattenableHeap), | 36 fPaints(&fFlattenableHeap), |
37 fRegions(&fFlattenableHeap), | 37 fRegions(&fFlattenableHeap), |
38 fRecordFlags(flags) { | 38 fRecordFlags(flags) { |
39 #ifdef SK_DEBUG_SIZE | 39 #ifdef SK_DEBUG_SIZE |
40 fPointBytes = fRectBytes = fTextBytes = 0; | 40 fPointBytes = fRectBytes = fTextBytes = 0; |
41 fPointWrites = fRectWrites = fTextWrites = 0; | 41 fPointWrites = fRectWrites = fTextWrites = 0; |
42 #endif | 42 #endif |
43 | 43 |
44 fRestoreOffsetStack.setReserve(32); | |
45 | |
46 fBitmapHeap = SkNEW(SkBitmapHeap); | 44 fBitmapHeap = SkNEW(SkBitmapHeap); |
47 fFlattenableHeap.setBitmapStorage(fBitmapHeap); | 45 fFlattenableHeap.setBitmapStorage(fBitmapHeap); |
48 fPathHeap = NULL; // lazy allocate | 46 fPathHeap = NULL; // lazy allocate |
49 fFirstSavedLayerIndex = kNoSavedLayerIndex; | 47 fFirstSavedLayerIndex = kNoSavedLayerIndex; |
50 | 48 |
51 fInitialSaveCount = kNoInitialSave; | 49 fInitialSaveCount = kNoInitialSave; |
52 } | 50 } |
53 | 51 |
54 SkPictureRecord::~SkPictureRecord() { | 52 SkPictureRecord::~SkPictureRecord() { |
55 SkSafeUnref(fBitmapHeap); | 53 SkSafeUnref(fBitmapHeap); |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 void SkPictureRecord::validateRegions() const { | 1526 void SkPictureRecord::validateRegions() const { |
1529 int count = fRegions.count(); | 1527 int count = fRegions.count(); |
1530 SkASSERT((unsigned) count < 0x1000); | 1528 SkASSERT((unsigned) count < 0x1000); |
1531 for (int index = 0; index < count; index++) { | 1529 for (int index = 0; index < count; index++) { |
1532 const SkFlatData* region = fRegions[index]; | 1530 const SkFlatData* region = fRegions[index]; |
1533 SkASSERT(region); | 1531 SkASSERT(region); |
1534 // region->validate(); | 1532 // region->validate(); |
1535 } | 1533 } |
1536 } | 1534 } |
1537 #endif | 1535 #endif |
OLD | NEW |