Index: src/gpu/GrResourceCache.h |
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h |
index 2171420a43f696fcde1c7dce1c9a7a6be157fbd8..f17c9f26777cedb4380e403fac21bb6f31d57baa 100644 |
--- a/src/gpu/GrResourceCache.h |
+++ b/src/gpu/GrResourceCache.h |
@@ -22,6 +22,7 @@ |
class GrCaps; |
class SkString; |
+class SkTraceMemoryDump; |
/** |
* Manages the lifetime of all GrGpuResource instances. |
@@ -130,7 +131,7 @@ public: |
GrGpuResource* findAndRefScratchResource(const GrScratchKey& scratchKey, |
size_t resourceSize, |
uint32_t flags); |
- |
+ |
#ifdef SK_DEBUG |
// This is not particularly fast and only used for validation, so debug only. |
int countScratchEntriesForKey(const GrScratchKey& scratchKey) const { |
@@ -178,7 +179,7 @@ public: |
fOverBudgetCB = overBudgetCB; |
fOverBudgetData = data; |
} |
- |
+ |
void notifyFlushOccurred(); |
#if GR_GPU_STATS |
@@ -188,6 +189,9 @@ public: |
// This function is for unit testing and is only defined in test tools. |
void changeTimestamp(uint32_t newTimestamp); |
+ // Enumerates all cached resources and dumps their details to traceMemoryDump. |
+ void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const; |
+ |
private: |
/////////////////////////////////////////////////////////////////////////// |
/// @name Methods accessible via ResourceAccess |
@@ -210,7 +214,7 @@ private: |
bool overBudget() const { return fBudgetedBytes > fMaxBytes || fBudgetedCount > fMaxCount; } |
bool wouldFit(size_t bytes) { |
- return fBudgetedBytes+bytes <= fMaxBytes && fBudgetedCount+1 <= fMaxCount; |
+ return fBudgetedBytes + bytes <= fMaxBytes && fBudgetedCount + 1 <= fMaxCount; |
} |
uint32_t getNextTimestamp(); |