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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « include/gpu/GrConfig.h ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrResourceCache.h" 9 #include "GrResourceCache.h"
10 #include "GrGpuResource.h" 10 #include "GrGpuResource.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 size_t bytes = this->countBytes(fList); 397 size_t bytes = this->countBytes(fList);
398 SkASSERT(bytes == fEntryBytes); 398 SkASSERT(bytes == fEntryBytes);
399 SkASSERT(fList.countEntries() == fEntryCount); 399 SkASSERT(fList.countEntries() == fEntryCount);
400 } 400 }
401 #endif // SK_DEBUG 401 #endif // SK_DEBUG
402 402
403 #if GR_CACHE_STATS 403 #if GR_CACHE_STATS
404 404
405 void GrResourceCache::printStats() { 405 void GrResourceCache::printStats() {
406 int locked = 0; 406 int locked = 0;
407 int scratch = 0;
407 408
408 EntryList::Iter iter; 409 EntryList::Iter iter;
409 410
410 GrResourceCacheEntry* entry = iter.init(fList, EntryList::Iter::kTail_IterSt art); 411 GrResourceCacheEntry* entry = iter.init(fList, EntryList::Iter::kTail_IterSt art);
411 412
412 for ( ; entry; entry = iter.prev()) { 413 for ( ; entry; entry = iter.prev()) {
413 if (entry->fResource->getRefCnt() > 1) { 414 if (!entry->fResource->isPurgable()) {
414 ++locked; 415 ++locked;
415 } 416 }
417 if (entry->fResource->isScratch()) {
418 ++scratch;
419 }
416 } 420 }
417 421
422 float countUtilization = (100.f * fEntryCount) / fMaxCount;
423 float byteUtilization = (100.f * fEntryBytes) / fMaxBytes;
424
418 SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes); 425 SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);
419 SkDebugf("\t\tEntry Count: current %d (%d locked) high %d\n", 426 SkDebugf("\t\tEntry Count: current %d (%d locked, %d scratch %.2g%% full), h igh %d\n",
420 fEntryCount, locked, fHighWaterEntryCount); 427 fEntryCount, locked, scratch, countUtilization, fHighWaterEntryC ount);
421 SkDebugf("\t\tEntry Bytes: current %d high %d\n", 428 SkDebugf("\t\tEntry Bytes: current %d (%.2g%% full) high %d\n",
422 fEntryBytes, fHighWaterEntryBytes); 429 fEntryBytes, byteUtilization, fHighWaterEntryBytes);
423 } 430 }
424 431
425 #endif 432 #endif
426 433
427 /////////////////////////////////////////////////////////////////////////////// 434 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« 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