Only display program cache info if RTConf flag is set.

Addresses: https://code.google.com/p/skia/issues/detail?id=1615

R=caryclark@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/23947006

git-svn-id: http://skia.googlecode.com/svn/trunk@11300 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
jvanverth@google.com 2013-09-16 19:40:31 +00:00
parent fe66c08c66
commit 5c9b6faeff

View File

@ -9,8 +9,12 @@
#include "GrEffect.h"
#include "GrGLEffect.h"
#include "SkRTConf.h"
#include "SkTSearch.h"
SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false,
"Display program cache usage.");
typedef GrGLUniformManager::UniformHandle UniformHandle;
struct GrGpuGL::ProgramCache::Entry {
@ -56,15 +60,17 @@ GrGpuGL::ProgramCache::~ProgramCache() {
}
// dump stats
#ifdef PROGRAM_CACHE_STATS
SkDebugf("--- Program Cache ---\n");
SkDebugf("Total requests: %d\n", fTotalRequests);
SkDebugf("Cache misses: %d\n", fCacheMisses);
SkDebugf("Cache miss %%: %f\n", (fTotalRequests > 0) ?
100.f * fCacheMisses / fTotalRequests :
0.f);
int cacheHits = fTotalRequests - fCacheMisses;
SkDebugf("Hash miss %%: %f\n", (cacheHits > 0) ? 100.f * fHashMisses / cacheHits : 0.f);
SkDebugf("---------------------\n");
if (c_DisplayCache) {
SkDebugf("--- Program Cache ---\n");
SkDebugf("Total requests: %d\n", fTotalRequests);
SkDebugf("Cache misses: %d\n", fCacheMisses);
SkDebugf("Cache miss %%: %f\n", (fTotalRequests > 0) ?
100.f * fCacheMisses / fTotalRequests :
0.f);
int cacheHits = fTotalRequests - fCacheMisses;
SkDebugf("Hash miss %%: %f\n", (cacheHits > 0) ? 100.f * fHashMisses / cacheHits : 0.f);
SkDebugf("---------------------\n");
}
#endif
}