aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ImageCacheBench.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-15 10:15:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-15 10:15:18 -0700
commit595aa05efcb504e85358b8d328ac4a9fa1c46e2e (patch)
tree573f666cd9ed981bca2d33ed384051e95ff3412d /bench/ImageCacheBench.cpp
parent81940de68893e6a643301f9930db630764729ea8 (diff)
Revert of Change SkResourceCache to take a Visitor inside its find(). (patchset #2 id:20001 of https://codereview.chromium.org/567393002/)
Reason for revert: crashes on android bots, haven't diagnosed yet Original issue's description: > Change SkResourceCache to take a Visitor inside its find(). > > This simplifies the API/contract, in that there are not any exposed > lock/unlock scopes. > > > patch from issue 572573002 > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/dee6a8e67db39fcbde2b3bb09be1d088ebb9db8a R=mtklein@google.com, danakj@chromium.org TBR=danakj@chromium.org, mtklein@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/569303002
Diffstat (limited to 'bench/ImageCacheBench.cpp')
-rw-r--r--bench/ImageCacheBench.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/bench/ImageCacheBench.cpp b/bench/ImageCacheBench.cpp
index 0f8fdf2708..ca2b9342d5 100644
--- a/bench/ImageCacheBench.cpp
+++ b/bench/ImageCacheBench.cpp
@@ -27,10 +27,6 @@ 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;
- }
};
}
@@ -45,7 +41,7 @@ public:
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 @@ protected:
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);
}
}