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

Side by Side Diff: src/gpu/GrAllocator.h

Issue 23703010: Replace uses of GR_DEBUGCODE by SkDEBUGCODE. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrAllocPool.cpp ('k') | src/gpu/GrBlend.cpp » ('j') | 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 2010 Google Inc. 3 * Copyright 2010 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 8
9 9
10 10
(...skipping 20 matching lines...) Expand all
31 * Caller is responsible for freeing this memory. 31 * Caller is responsible for freeing this memory.
32 */ 32 */
33 GrAllocator(size_t itemSize, int itemsPerBlock, void* initialBlock) : 33 GrAllocator(size_t itemSize, int itemsPerBlock, void* initialBlock) :
34 fItemSize(itemSize), 34 fItemSize(itemSize),
35 fItemsPerBlock(itemsPerBlock), 35 fItemsPerBlock(itemsPerBlock),
36 fOwnFirstBlock(NULL == initialBlock), 36 fOwnFirstBlock(NULL == initialBlock),
37 fCount(0) { 37 fCount(0) {
38 SkASSERT(itemsPerBlock > 0); 38 SkASSERT(itemsPerBlock > 0);
39 fBlockSize = fItemSize * fItemsPerBlock; 39 fBlockSize = fItemSize * fItemsPerBlock;
40 fBlocks.push_back() = initialBlock; 40 fBlocks.push_back() = initialBlock;
41 GR_DEBUGCODE(if (!fOwnFirstBlock) {*((char*)initialBlock+fBlockSize-1)=' a';} ); 41 SkDEBUGCODE(if (!fOwnFirstBlock) {*((char*)initialBlock+fBlockSize-1)='a ';} );
42 } 42 }
43 43
44 /** 44 /**
45 * Adds an item and returns pointer to it. 45 * Adds an item and returns pointer to it.
46 * 46 *
47 * @return pointer to the added item. 47 * @return pointer to the added item.
48 */ 48 */
49 void* push_back() { 49 void* push_back() {
50 int indexInBlock = fCount % fItemsPerBlock; 50 int indexInBlock = fCount % fItemsPerBlock;
51 // we always have at least one block 51 // we always have at least one block
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 public: 242 public:
243 GrSTAllocator() : INHERITED(N, fStorage.get()) { 243 GrSTAllocator() : INHERITED(N, fStorage.get()) {
244 } 244 }
245 245
246 private: 246 private:
247 SkAlignedSTStorage<N, T> fStorage; 247 SkAlignedSTStorage<N, T> fStorage;
248 }; 248 };
249 249
250 #endif 250 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAllocPool.cpp ('k') | src/gpu/GrBlend.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698