Chromium Code Reviews| Index: src/gpu/GrTest.cpp |
| diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp |
| index 29b13c7b7ccd52df1c1a4a37dc3fd230b3322929..086534566217b55605ffa7983e605e039b00f9e5 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,22 @@ 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); |
| + |
|
robertphillips
2015/12/02 21:02:13
Would it make sense for all these to have the same
joshualitt
2015/12/02 21:28:37
Acknowledged.
|
| + keys->push_back(SkString("total_cache_entries")); values->push_back(stats.fTotal); |
| + keys->push_back(SkString("external_cache_entries")); values->push_back(stats.fExternal); |
| + keys->push_back(SkString("borrowed_cache_entries")); values->push_back(stats.fBorrowed); |
| + keys->push_back(SkString("adopted_cache_entries")); values->push_back(stats.fAdopted); |
|
robertphillips
2015/12/02 21:02:13
fNumPurgeable too ?
joshualitt
2015/12/02 21:28:37
Acknowledged.
|
| + keys->push_back(SkString("non_purgable_cache_entries")); values->push_back(stats.fNumNonPurgeable); |
| + keys->push_back(SkString("scratch_cache_entries")); values->push_back(stats.fScratch); |
| + keys->push_back(SkString("cache_unbudgeted_size")); values->push_back(stats.fUnbudgetedSize); |
| +} |
| + |
| #endif |
| /////////////////////////////////////////////////////////////////////////////// |