Index: src/gpu/GrTest.cpp |
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp |
index 29b13c7b7ccd52df1c1a4a37dc3fd230b3322929..b1c135474df480b5a2d946a6cdeab46f5a0cc5f5 100644 |
--- a/src/gpu/GrTest.cpp |
+++ b/src/gpu/GrTest.cpp |
@@ -105,6 +105,13 @@ void GrContext::dumpCacheStats(SkString* out) const { |
#endif |
} |
+void GrContext::dumpCacheStatsKeyValuePairs(SkTArray<SkString>* keys, |
+ SkTArray<double>* values) const { |
+#if GR_CACHE_STATS |
+ fResourceCache->dumpStatsKeyValuePairs(keys, values); |
+#endif |
+} |
+ |
void GrContext::printCacheStats() const { |
SkString out; |
this->dumpCacheStats(&out); |
@@ -217,6 +224,23 @@ void GrResourceCache::dumpStats(SkString* out) const { |
SkToInt(stats.fUnbudgetedSize), SkToInt(fHighWaterBytes)); |
} |
+void GrResourceCache::dumpStatsKeyValuePairs(SkTArray<SkString>* keys, |
+ SkTArray<double>* values) const { |
+ this->validate(); |
+ |
+ Stats stats; |
+ this->getStats(&stats); |
+ |
+ keys->push_back(SkString("gpu_cache_total_entries")); values->push_back(stats.fTotal); |
+ keys->push_back(SkString("gpu_cache_external_entries")); values->push_back(stats.fExternal); |
+ keys->push_back(SkString("gpu_cache_borrowed_entries")); values->push_back(stats.fBorrowed); |
+ keys->push_back(SkString("gpu_cache_adopted_entries")); values->push_back(stats.fAdopted); |
+ keys->push_back(SkString("gpu_cache_purgable_entries")); values->push_back(stats.fNumPurgeable); |
+ keys->push_back(SkString("gpu_cache_non_purgable_entries")); values->push_back(stats.fNumNonPurgeable); |
+ keys->push_back(SkString("gpu_cache_scratch_entries")); values->push_back(stats.fScratch); |
+ keys->push_back(SkString("gpu_cache_unbudgeted_size")); values->push_back((double)stats.fUnbudgetedSize); |
+} |
+ |
#endif |
/////////////////////////////////////////////////////////////////////////////// |