Index: bench/ImageCacheBench.cpp |
diff --git a/bench/ImageCacheBench.cpp b/bench/ImageCacheBench.cpp |
index ca2b9342d515ba3186a0a8b4670a69d836561c1a..0f8fdf27089916b0df25d0aa49a0f60078b3fd39 100644 |
--- a/bench/ImageCacheBench.cpp |
+++ b/bench/ImageCacheBench.cpp |
@@ -27,6 +27,10 @@ struct TestRec : public SkResourceCache::Rec { |
virtual const Key& getKey() const SK_OVERRIDE { return fKey; } |
virtual size_t bytesUsed() const SK_OVERRIDE { return sizeof(fKey) + sizeof(fValue); } |
+ |
+ static bool Visitor(const SkResourceCache::Rec&, void*) { |
+ return true; |
+ } |
}; |
} |
@@ -41,7 +45,7 @@ public: |
void populateCache() { |
for (int i = 0; i < CACHE_COUNT; ++i) { |
- fCache.unlock(fCache.addAndLock(SkNEW_ARGS(TestRec, (TestKey(i), i)))); |
+ fCache.add(SkNEW_ARGS(TestRec, (TestKey(i), i))); |
} |
} |
@@ -58,8 +62,8 @@ protected: |
TestKey key(-1); |
// search for a miss (-1) |
for (int i = 0; i < loops; ++i) { |
- SkDEBUGCODE(SkResourceCache::ID id =) fCache.findAndLock(key); |
- SkASSERT(NULL == id); |
+ SkDEBUGCODE(bool found =) fCache.find(key, TestRec::Visitor, NULL); |
+ SkASSERT(!found); |
} |
} |