aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkResourceCache.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-11 12:22:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-11 12:22:34 -0700
commit56b00d9e7aecce7ffc6b915972cc3cbfbe051d7e (patch)
tree0e67589aa73f4f4fd8753dfebdc9485f9f0d2517 /src/core/SkResourceCache.h
parentf58a562d56b1c5898d1b5576301917b69aca4705 (diff)
add PurgeResourceCache to track leaks
TBR=halcananry Author: reed@google.com Review URL: https://codereview.chromium.org/554263005
Diffstat (limited to 'src/core/SkResourceCache.h')
-rw-r--r--src/core/SkResourceCache.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index 93f2ca49e6..dacd62cedb 100644
--- a/src/core/SkResourceCache.h
+++ b/src/core/SkResourceCache.h
@@ -106,6 +106,8 @@ public:
static size_t SetSingleAllocationByteLimit(size_t);
static size_t GetSingleAllocationByteLimit();
+ static void PurgeAll();
+
/**
* Use this allocator for bitmaps, so they can use ashmem when available.
* Returns NULL if the ResourceCache has not been initialized with a DiscardableFactory.
@@ -167,6 +169,10 @@ public:
*/
size_t setTotalByteLimit(size_t newLimit);
+ void purgeAll() {
+ this->purgeAsNeeded(true);
+ }
+
SkBitmap::Allocator* allocator() const { return fAllocator; };
/**
@@ -190,7 +196,7 @@ private:
size_t fSingleAllocationByteLimit;
int fCount;
- void purgeAsNeeded();
+ void purgeAsNeeded(bool forcePurge = false);
// linklist management
void moveToHead(Rec*);