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

Unified Diff: src/gpu/GrResourceCache2.cpp

Issue 886233004: Print gpu/cache stats from DM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: minor Created 5 years, 11 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
Index: src/gpu/GrResourceCache2.cpp
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 65894d33141213c614491072acac28eb215a56e6..08bee47b6e80e7a9adadc1658e8a5839bec45999 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -483,43 +483,3 @@ void GrResourceCache2::validate() const {
// SkASSERT(!overBudget || locked == count || fPurging);
}
#endif
-
-#if GR_CACHE_STATS
-void GrResourceCache2::printStats() const {
- this->validate();
-
- int locked = 0;
- int scratch = 0;
- int wrapped = 0;
- size_t unbudgetedSize = 0;
-
- ResourceList::Iter iter;
- GrGpuResource* resource = iter.init(fResources, ResourceList::Iter::kHead_IterStart);
-
- for ( ; resource; resource = iter.next()) {
- if (!resource->isPurgeable()) {
- ++locked;
- }
- if (resource->cacheAccess().isScratch()) {
- ++scratch;
- }
- if (resource->cacheAccess().isWrapped()) {
- ++wrapped;
- }
- if (!resource->cacheAccess().isBudgeted()) {
- unbudgetedSize += resource->gpuMemorySize();
- }
- }
-
- float countUtilization = (100.f * fBudgetedCount) / fMaxCount;
- float byteUtilization = (100.f * fBudgetedBytes) / fMaxBytes;
-
- SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);
- SkDebugf("\t\tEntry Count: current %d"
- " (%d budgeted, %d wrapped, %d locked, %d scratch %.2g%% full), high %d\n",
- fCount, fBudgetedCount, wrapped, locked, scratch, countUtilization, fHighWaterCount);
- SkDebugf("\t\tEntry Bytes: current %d (budgeted %d, %.2g%% full, %d unbudgeted) high %d\n",
- fBytes, fBudgetedBytes, byteUtilization, unbudgetedSize, fHighWaterBytes);
-}
-
-#endif

Powered by Google App Engine
This is Rietveld 408576698