Index: tools/bench_pictures_main.cpp |
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp |
index 2eda73c40fa245a2197b00ef689d75f72267add4..ade93fc3e6f05108df5aa8695818d41b929269cf 100644 |
--- a/tools/bench_pictures_main.cpp |
+++ b/tools/bench_pictures_main.cpp |
@@ -54,6 +54,11 @@ DEFINE_bool(trackDeferredCaching, false, "Only meaningful with --deferImageDecod |
"SK_LAZY_CACHE_STATS set to true. Report percentage of cache hits when using " |
"deferred image decoding."); |
+#if GR_GPU_STATS |
+DEFINE_bool(gpuStats, false, "Only meaningful with gpu configurations. " |
+ "Report some GPU call statistics."); |
+#endif |
+ |
DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing before timing."); |
// Buildbot-specific parameters |
@@ -476,6 +481,15 @@ int tool_main(int argc, char** argv) { |
(double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses)); |
} |
#endif |
+ |
+#if GR_GPU_STATS |
+ if (FLAGS_gpuStats && benchmark.renderer()->isUsingGpuDevice()) { |
+ GrContext* ctx = benchmark.renderer()->getGrContext(); |
+ SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds()); |
+ SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilations()); |
+ } |
+#endif |
+ |
gWriter.end(); |
return 0; |
} |