Guard high water cache stats vars by GR_CACHE_STATS
TBR=halcanary@google.com NOTRY=true Review URL: https://codereview.chromium.org/729753003
This commit is contained in:
parent
12299ab7a1
commit
82b1d62013
@ -95,9 +95,11 @@ void GrResourceCache2::insertResource(GrGpuResource* resource) {
|
||||
fResources.addToHead(resource);
|
||||
|
||||
++fCount;
|
||||
SkDEBUGCODE(fHighWaterCount = SkTMax(fCount, fHighWaterCount));
|
||||
fBytes += resource->gpuMemorySize();
|
||||
SkDEBUGCODE(fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes));
|
||||
#if GR_CACHE_STATS
|
||||
fHighWaterCount = SkTMax(fCount, fHighWaterCount);
|
||||
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
|
||||
#endif
|
||||
if (!resource->cacheAccess().getScratchKey().isNullScratch()) {
|
||||
// TODO(bsalomon): Make this assertion possible.
|
||||
// SkASSERT(!resource->isWrapped());
|
||||
@ -256,7 +258,9 @@ void GrResourceCache2::didChangeGpuMemorySize(const GrGpuResource* resource, siz
|
||||
SkASSERT(this->isInCache(resource));
|
||||
|
||||
fBytes += resource->gpuMemorySize() - oldSize;
|
||||
SkDEBUGCODE(fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes));
|
||||
#if GR_CACHE_STATS
|
||||
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
|
||||
#endif
|
||||
|
||||
this->purgeAsNeeded();
|
||||
this->validate();
|
||||
|
Loading…
Reference in New Issue
Block a user