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

Unified Diff: tools/bench_pictures_main.cpp

Issue 223403012: SkDiscardableMemoryPool to abstract class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 9 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 | « tests/ImageCacheTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_pictures_main.cpp
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 5829e1822f1157cd9a942e190ebb611d78037405..4952571fade30f71f29cc0dece167032047b6b94 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -46,8 +46,8 @@ DEFINE_bool(purgeDecodedTex, false, "Purge decoded and GPU-uploaded textures "
DEFINE_string(timers, "c", "[wcgWC]*: Display wall, cpu, gpu, truncated wall or truncated cpu time"
" for each picture.");
DEFINE_bool(trackDeferredCaching, false, "Only meaningful with --deferImageDecoding and "
- "LAZY_CACHE_STATS set to true. Report percentage of cache hits when using deferred "
- "image decoding.");
+ "SK_LAZY_CACHE_STATS set to true. Report percentage of cache hits when using "
+ "deferred image decoding.");
static char const * const gFilterTypes[] = {
"paint",
@@ -142,7 +142,7 @@ static SkString filterFlagsUsage() {
return result;
}
-#if LAZY_CACHE_STATS
+#if SK_LAZY_CACHE_STATS
static int32_t gTotalCacheHits;
static int32_t gTotalCacheMisses;
#endif
@@ -192,11 +192,11 @@ static bool run_single_benchmark(const SkString& inputPath,
benchmark.run(picture);
-#if LAZY_CACHE_STATS
+#if SK_LAZY_CACHE_STATS
if (FLAGS_trackDeferredCaching) {
- int32_t cacheHits = pool->fCacheHits;
- int32_t cacheMisses = pool->fCacheMisses;
- pool->fCacheHits = pool->fCacheMisses = 0;
+ int cacheHits = pool->getCacheHits();
+ int cacheMisses = pool->getCacheMisses();
+ pool->resetCacheHitsAndMisses();
SkString hitString;
hitString.printf("Cache hit rate: %f\n", (double) cacheHits / (cacheHits + cacheMisses));
gLogger.logProgress(hitString);
@@ -435,7 +435,7 @@ int tool_main(int argc, char** argv) {
gLogger.logError(err);
return 1;
}
-#if LAZY_CACHE_STATS
+#if SK_LAZY_CACHE_STATS
if (FLAGS_trackDeferredCaching) {
SkDebugf("Total cache hit rate: %f\n",
(double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses));
« no previous file with comments | « tests/ImageCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698