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

Side by Side Diff: src/gpu/GrResourceCache2.cpp

Issue 894013002: patch from issue 886233004 at patchset 40001 (http://crrev.com/886233004#ps40001) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrResourceCache2.h ('k') | src/gpu/GrTest.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 2014 Google Inc. 3 * Copyright 2014 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 9
10 #include "GrResourceCache2.h" 10 #include "GrResourceCache2.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 #endif 476 #endif
477 SkASSERT(content == fContentHash.count()); 477 SkASSERT(content == fContentHash.count());
478 SkASSERT(scratch + couldBeScratch == fScratchMap.count()); 478 SkASSERT(scratch + couldBeScratch == fScratchMap.count());
479 479
480 // This assertion is not currently valid because we can be in recursive noti fyIsPurgeable() 480 // This assertion is not currently valid because we can be in recursive noti fyIsPurgeable()
481 // calls. This will be fixed when subresource registration is explicit. 481 // calls. This will be fixed when subresource registration is explicit.
482 // bool overBudget = budgetedBytes > fMaxBytes || budgetedCount > fMaxCount; 482 // bool overBudget = budgetedBytes > fMaxBytes || budgetedCount > fMaxCount;
483 // SkASSERT(!overBudget || locked == count || fPurging); 483 // SkASSERT(!overBudget || locked == count || fPurging);
484 } 484 }
485 #endif 485 #endif
486
487 #if GR_CACHE_STATS
488 void GrResourceCache2::printStats() const {
489 this->validate();
490
491 int locked = 0;
492 int scratch = 0;
493 int wrapped = 0;
494 size_t unbudgetedSize = 0;
495
496 ResourceList::Iter iter;
497 GrGpuResource* resource = iter.init(fResources, ResourceList::Iter::kHead_It erStart);
498
499 for ( ; resource; resource = iter.next()) {
500 if (!resource->isPurgeable()) {
501 ++locked;
502 }
503 if (resource->cacheAccess().isScratch()) {
504 ++scratch;
505 }
506 if (resource->cacheAccess().isWrapped()) {
507 ++wrapped;
508 }
509 if (!resource->cacheAccess().isBudgeted()) {
510 unbudgetedSize += resource->gpuMemorySize();
511 }
512 }
513
514 float countUtilization = (100.f * fBudgetedCount) / fMaxCount;
515 float byteUtilization = (100.f * fBudgetedBytes) / fMaxBytes;
516
517 SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);
518 SkDebugf("\t\tEntry Count: current %d"
519 " (%d budgeted, %d wrapped, %d locked, %d scratch %.2g%% full), hig h %d\n",
520 fCount, fBudgetedCount, wrapped, locked, scratch, countUtilization, fHig hWaterCount);
521 SkDebugf("\t\tEntry Bytes: current %d (budgeted %d, %.2g%% full, %d unbudget ed) high %d\n",
522 fBytes, fBudgetedBytes, byteUtilization, unbudgetedSize, fHighWa terBytes);
523 }
524
525 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache2.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698