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

Unified Diff: src/gpu/GrTest.cpp

Issue 1489033004: Began logging more gpu stats from nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: no gpu support Created 5 years 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 | « src/gpu/GrGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTest.cpp
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp
index f0f63702541a115fbb734be46fd17d48caf1e620..357cd41c51b216f303804c3a76d6a1daf141b72c 100644
--- a/src/gpu/GrTest.cpp
+++ b/src/gpu/GrTest.cpp
@@ -93,6 +93,12 @@ void GrContext::purgeAllUnlockedResources() {
fResourceCache->purgeAllUnlocked();
}
+void GrContext::resetGpuStats() const {
+#if GR_GPU_STATS
+ fGpu->stats()->reset();
+#endif
+}
+
void GrContext::dumpCacheStats(SkString* out) const {
#if GR_CACHE_STATS
fResourceCache->dumpStats(out);
@@ -111,6 +117,13 @@ void GrContext::dumpGpuStats(SkString* out) const {
#endif
}
+void GrContext::dumpGpuStatsKeyValuePairs(SkTArray<SkString>* keys,
+ SkTArray<double>* values) const {
+#if GR_GPU_STATS
+ return fGpu->stats()->dumpKeyValuePairs(keys, values);
+#endif
+}
+
void GrContext::printGpuStats() const {
SkString out;
this->dumpGpuStats(&out);
@@ -155,6 +168,16 @@ void GrGpu::Stats::dump(SkString* out) {
out->appendf("Stencil Buffer Creates: %d\n", fStencilAttachmentCreates);
out->appendf("Number of draws: %d\n", fNumDraws);
}
+
+void GrGpu::Stats::dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>* values) {
+ keys->push_back(SkString("render_target_binds")); values->push_back(fRenderTargetBinds);
+ keys->push_back(SkString("shader_compilations")); values->push_back(fShaderCompilations);
+ keys->push_back(SkString("textures_created")); values->push_back(fTextureCreates);
+ keys->push_back(SkString("texture_uploads")); values->push_back(fTextureUploads);
+ keys->push_back(SkString("stencil_buffer_creates")); values->push_back(fStencilAttachmentCreates);
+ keys->push_back(SkString("number_of_draws")); values->push_back(fNumDraws);
+}
+
#endif
#if GR_CACHE_STATS
« no previous file with comments | « src/gpu/GrGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698