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:
parent
fe66c08c66
commit
5c9b6faeff
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user