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

Unified Diff: bench/ImageCacheBench.cpp

Issue 511283002: rename ScaledImageCache to ResourceCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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 | gyp/core.gypi » ('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 f4d88da0424d75a0c11f9f9495ee63f8dbbde59d..ca2b9342d515ba3186a0a8b4670a69d836561c1a 100644
--- a/bench/ImageCacheBench.cpp
+++ b/bench/ImageCacheBench.cpp
@@ -6,11 +6,11 @@
*/
#include "Benchmark.h"
-#include "SkScaledImageCache.h"
+#include "SkResourceCache.h"
namespace {
static void* gGlobalAddress;
-class TestKey : public SkScaledImageCache::Key {
+class TestKey : public SkResourceCache::Key {
public:
void* fPtr;
intptr_t fValue;
@@ -19,7 +19,7 @@ public:
this->init(sizeof(fPtr) + sizeof(fValue));
}
};
-struct TestRec : public SkScaledImageCache::Rec {
+struct TestRec : public SkResourceCache::Rec {
TestKey fKey;
intptr_t fValue;
@@ -31,17 +31,13 @@ struct TestRec : public SkScaledImageCache::Rec {
}
class ImageCacheBench : public Benchmark {
- SkScaledImageCache fCache;
- SkBitmap fBM;
+ SkResourceCache fCache;
enum {
- DIM = 1,
CACHE_COUNT = 500
};
public:
- ImageCacheBench() : fCache(CACHE_COUNT * 100) {
- fBM.allocN32Pixels(DIM, DIM);
- }
+ ImageCacheBench() : fCache(CACHE_COUNT * 100) {}
void populateCache() {
for (int i = 0; i < CACHE_COUNT; ++i) {
@@ -62,7 +58,7 @@ protected:
TestKey key(-1);
// search for a miss (-1)
for (int i = 0; i < loops; ++i) {
- SkDEBUGCODE(SkScaledImageCache::ID id =) fCache.findAndLock(key);
+ SkDEBUGCODE(SkResourceCache::ID id =) fCache.findAndLock(key);
SkASSERT(NULL == id);
}
}
« no previous file with comments | « no previous file | gyp/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698