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

Unified Diff: src/gpu/GrMemoryPool.h

Issue 1055843002: Adding a cache + memory pool for GPU TextBlobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atlastext2
Patch Set: feedback inc Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrMemoryPool.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrMemoryPool.h
diff --git a/src/gpu/GrMemoryPool.h b/src/gpu/GrMemoryPool.h
index 5ab8958a8a2539ddb16783fbc806c259c66d8a6b..4de641d9fcb31327535762a79b0528803a6d9701 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
};
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrMemoryPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698