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

Unified Diff: src/core/SkResourceCache.h

Issue 554263005: add PurgeResourceCache to track leaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/core/SkGraphics.cpp ('k') | src/core/SkResourceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkResourceCache.h
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index 93f2ca49e686d7ab2273b54ca0a8ca352cf8ab74..dacd62cedb914af54e07b7b805d7d6a9e243d970 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*);
« no previous file with comments | « src/core/SkGraphics.cpp ('k') | src/core/SkResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698