aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrMemoryPool.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-04-08 09:08:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-08 09:08:31 -0700
commitb7133bed55af8dd4ca9427892bb1a5623dbaccf0 (patch)
tree4bcd9cdde8588e40b5c388dea7b715755155a51c /src/gpu/GrMemoryPool.h
parent2ad228e8ff3ad7050c58d563879b9831c688e2f1 (diff)
Adding a cache + memory pool for GPU TextBlobs
Diffstat (limited to 'src/gpu/GrMemoryPool.h')
-rw-r--r--src/gpu/GrMemoryPool.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrMemoryPool.h b/src/gpu/GrMemoryPool.h
index 5ab8958a8a..4de641d9fc 100644
--- a/src/gpu/GrMemoryPool.h
+++ b/src/gpu/GrMemoryPool.h
@@ -43,6 +43,11 @@ public:
*/
bool isEmpty() const { return fTail == fHead && !fHead->fLiveCount; }
+ /**
+ * Returns the total allocated size of the GrMemoryPool
+ */
+ size_t size() const { return fSize; }
+
private:
struct BlockHeader;
@@ -60,6 +65,7 @@ private:
intptr_t fCurrPtr; ///< ptr to the start of blocks free space.
intptr_t fPrevPtr; ///< ptr to the last allocation made
size_t fFreeSize; ///< amount of free space left in the block.
+ size_t fSize; ///< total allocated size of the block
};
enum {
@@ -68,12 +74,14 @@ private:
kHeaderSize = GR_CT_ALIGN_UP(sizeof(BlockHeader), kAlignment),
kPerAllocPad = GR_CT_ALIGN_UP(sizeof(BlockHeader*), kAlignment),
};
+ size_t fSize;
size_t fPreallocSize;
size_t fMinAllocSize;
BlockHeader* fHead;
BlockHeader* fTail;
#ifdef SK_DEBUG
int fAllocationCnt;
+ int fAllocBlockCnt;
#endif
};