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

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

Issue 1552283002: Return 'correct' size from GrMemoryPool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 4 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 | src/gpu/GrMemoryPool.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 GrMemoryPool_DEFINED 8 #ifndef GrMemoryPool_DEFINED
9 #define GrMemoryPool_DEFINED 9 #define GrMemoryPool_DEFINED
10 10
(...skipping 26 matching lines...) Expand all
37 * p must have been returned by allocate() 37 * p must have been returned by allocate()
38 */ 38 */
39 void release(void* p); 39 void release(void* p);
40 40
41 /** 41 /**
42 * Returns true if there are no unreleased allocations. 42 * Returns true if there are no unreleased allocations.
43 */ 43 */
44 bool isEmpty() const { return fTail == fHead && !fHead->fLiveCount; } 44 bool isEmpty() const { return fTail == fHead && !fHead->fLiveCount; }
45 45
46 /** 46 /**
47 * Returns the total allocated size of the GrMemoryPool 47 * Returns the total allocated size of the GrMemoryPool minus any preallocat ed amount
48 */ 48 */
49 size_t size() const { return fSize; } 49 size_t size() const { return fSize; }
50 50
51 private: 51 private:
52 struct BlockHeader; 52 struct BlockHeader;
53 53
54 static BlockHeader* CreateBlock(size_t size); 54 static BlockHeader* CreateBlock(size_t size);
55 55
56 static void DeleteBlock(BlockHeader* block); 56 static void DeleteBlock(BlockHeader* block);
57 57
(...skipping 21 matching lines...) Expand all
79 size_t fMinAllocSize; 79 size_t fMinAllocSize;
80 BlockHeader* fHead; 80 BlockHeader* fHead;
81 BlockHeader* fTail; 81 BlockHeader* fTail;
82 #ifdef SK_DEBUG 82 #ifdef SK_DEBUG
83 int fAllocationCnt; 83 int fAllocationCnt;
84 int fAllocBlockCnt; 84 int fAllocBlockCnt;
85 #endif 85 #endif
86 }; 86 };
87 87
88 #endif 88 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrMemoryPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698