Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: src/core/SkPictureRecord.cpp

Issue 132693009: Remove a stray setReserve that causes dynamic allocation in picture creation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698