Index: src/core/SkResourceCache.h |
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h |
index 883ed189de2ede2094eb51ab8884fe2ea60fed5a..d2df35e7d511da17c1ba440c22b487d6617afabc 100644 |
--- a/src/core/SkResourceCache.h |
+++ b/src/core/SkResourceCache.h |
@@ -35,6 +35,8 @@ public: |
// length must be a multiple of 4 |
void init(void* nameSpace, size_t length); |
+ void* getNamespace() const { return fNamespace; } |
+ |
// This is only valid after having called init(). |
uint32_t hash() const { return fHash; } |
@@ -124,6 +126,13 @@ public: |
static size_t SetSingleAllocationByteLimit(size_t); |
static size_t GetSingleAllocationByteLimit(); |
+ /** |
+ * Visit all Rec that match the specified namespace: |
+ * true : Rec is valid |
mtklein
2015/01/07 21:52:43
I think everything might read more clearly if we h
reed1
2015/01/07 22:20:41
I agree 0.499999, but Find uses the same VisitorPr
mtklein
2015/01/08 14:11:12
Do you think we'll ever want to pass the same func
reed1
2015/02/18 17:30:32
Changed to new signature.
|
+ * false : Rec is "stale" -- the cache will purge it. |
+ */ |
+ static void PurgeVisitor(const void* nameSpace, VisitorProc, void* context); |
+ |
static void PurgeAll(); |
/** |
@@ -193,6 +202,8 @@ public: |
*/ |
size_t setTotalByteLimit(size_t newLimit); |
+ void purgeVisitor(const void* nameSpace, VisitorProc, void* context); |
+ |
void purgeAll() { |
this->purgeAsNeeded(true); |
} |