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

Unified Diff: bench/ImageCacheBench.cpp

Issue 569303002: Revert of Change SkResourceCache to take a Visitor inside its find(). (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 | « no previous file | src/core/SkBitmapCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | src/core/SkBitmapCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698