Index: bench/ImageCacheBench.cpp |
diff --git a/bench/ImageCacheBench.cpp b/bench/ImageCacheBench.cpp |
index 0f8fdf27089916b0df25d0aa49a0f60078b3fd39..ca2b9342d515ba3186a0a8b4670a69d836561c1a 100644 |
--- a/bench/ImageCacheBench.cpp |
+++ b/bench/ImageCacheBench.cpp |
@@ -27,10 +27,6 @@ |
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; |
- } |
}; |
} |
@@ -45,7 +41,7 @@ |
void populateCache() { |
for (int i = 0; i < CACHE_COUNT; ++i) { |
- fCache.add(SkNEW_ARGS(TestRec, (TestKey(i), i))); |
+ fCache.unlock(fCache.addAndLock(SkNEW_ARGS(TestRec, (TestKey(i), i)))); |
} |
} |
@@ -62,8 +58,8 @@ |
TestKey key(-1); |
// search for a miss (-1) |
for (int i = 0; i < loops; ++i) { |
- SkDEBUGCODE(bool found =) fCache.find(key, TestRec::Visitor, NULL); |
- SkASSERT(!found); |
+ SkDEBUGCODE(SkResourceCache::ID id =) fCache.findAndLock(key); |
+ SkASSERT(NULL == id); |
} |
} |