Index: include/lazy/SkLruImageCache.h |
diff --git a/include/lazy/SkLruImageCache.h b/include/lazy/SkLruImageCache.h |
index 44446000cdf0f96370c8ecbed5cbe40a555d8b89..7e90531ed066f85433a8b6f5017155f9810b16af 100644 |
--- a/include/lazy/SkLruImageCache.h |
+++ b/include/lazy/SkLruImageCache.h |
@@ -28,8 +28,21 @@ public: |
CacheStatus getCacheStatus(intptr_t ID) const SK_OVERRIDE; |
#endif |
reed1
2013/03/04 20:07:27
existing API naming we use for font cache. Maybe w
scroggo
2013/03/04 20:49:29
Done. Currently, we do not have a notion like the
|
+ /** |
+ * Set the budget. If more bytes are used than this, the cache will free unpinned memory until |
+ * under the new budget or until all unpinned memory is freed. This will never free pinned |
+ * memory, so the cache can potentially remain over budget. The budget is enforced each time |
+ * memory is allocated or released. |
+ * 0 is a special flag for an infinite budget. |
+ */ |
void setBudget(size_t newBudget); |
+ /** |
+ * Return the amount of memory currently in use by the cache. Can include memory that is no |
+ * longer pinned, but has not been freed. |
+ */ |
+ size_t getRamUsed() const { return fRamUsed; } |
+ |
virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) SK_OVERRIDE; |
virtual void* pinCache(intptr_t ID) SK_OVERRIDE; |
virtual void releaseCache(intptr_t ID) SK_OVERRIDE; |