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

Unified Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 23947006: Only display program cache info if RTConf flag is set. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL_program.cpp
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 159d6d804a611c6fd0c424baabefa8a0c81dfbef..7576af6215f0111deb12151a8efc8842f7c58599 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -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
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698