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

Unified Diff: src/gpu/GrResourceCache2.cpp

Issue 729753003: Guard high water cache stats vars by GR_CACHE_STATS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache2.cpp
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 3f7498c325c2a3044da30ec20878d4f9d66ed6e0..4593b82a7b57915fb2c2260d6062ef441f7972c9 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698