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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 655263005: Build gpu stats tracking in dev builds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up macro usage in render_pictures Created 6 years, 2 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 | « include/gpu/GrConfig.h ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index f50ed7d032f5988f48a04f36cd30d6e6cffb983a..f70d141c72aeb6e461a2d5510cfc4421b16dc71e 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -404,22 +404,29 @@ void GrResourceCache::validate() const {
void GrResourceCache::printStats() {
int locked = 0;
+ int scratch = 0;
EntryList::Iter iter;
GrResourceCacheEntry* entry = iter.init(fList, EntryList::Iter::kTail_IterStart);
for ( ; entry; entry = iter.prev()) {
- if (entry->fResource->getRefCnt() > 1) {
+ if (!entry->fResource->isPurgable()) {
++locked;
}
+ if (entry->fResource->isScratch()) {
+ ++scratch;
+ }
}
+ float countUtilization = (100.f * fEntryCount) / fMaxCount;
+ float byteUtilization = (100.f * fEntryBytes) / fMaxBytes;
+
SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);
- SkDebugf("\t\tEntry Count: current %d (%d locked) high %d\n",
- fEntryCount, locked, fHighWaterEntryCount);
- SkDebugf("\t\tEntry Bytes: current %d high %d\n",
- fEntryBytes, fHighWaterEntryBytes);
+ SkDebugf("\t\tEntry Count: current %d (%d locked, %d scratch %.2g%% full), high %d\n",
+ fEntryCount, locked, scratch, countUtilization, fHighWaterEntryCount);
+ SkDebugf("\t\tEntry Bytes: current %d (%.2g%% full) high %d\n",
+ fEntryBytes, byteUtilization, fHighWaterEntryBytes);
}
#endif
« no previous file with comments | « include/gpu/GrConfig.h ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698