Allow cache tracking to be enabled in release

https://codereview.appspot.com/6500057/



git-svn-id: http://skia.googlecode.com/svn/trunk@5365 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 3a3bd73..ee127c8 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -68,7 +68,7 @@
 GrResourceCache::GrResourceCache(int maxCount, size_t maxBytes) :
         fMaxCount(maxCount),
         fMaxBytes(maxBytes) {
-#if GR_DEBUG
+#if GR_CACHE_STATS
     fHighWaterEntryCount          = 0;
     fHighWaterUnlockedEntryCount  = 0;
     fHighWaterEntryBytes          = 0;
@@ -137,7 +137,7 @@
         fClientDetachedCount += 1;
         fClientDetachedBytes += entry->resource()->sizeInBytes();
 
-#if GR_DEBUG
+#if GR_CACHE_STATS
         if (fHighWaterClientDetachedCount < fClientDetachedCount) {
             fHighWaterClientDetachedCount = fClientDetachedCount;
         }
@@ -158,7 +158,7 @@
 
     if (!entry->isLocked()) {
         ++fUnlockedEntryCount;
-#if GR_DEBUG
+#if GR_CACHE_STATS
         if (fHighWaterUnlockedEntryCount < fUnlockedEntryCount) {
             fHighWaterUnlockedEntryCount = fUnlockedEntryCount;
         }
@@ -173,7 +173,7 @@
         fEntryCount += 1;
         fEntryBytes += entry->resource()->sizeInBytes();
 
-#if GR_DEBUG
+#if GR_CACHE_STATS
         if (fHighWaterEntryCount < fEntryCount) {
             fHighWaterEntryCount = fEntryCount;
         }
@@ -308,7 +308,7 @@
     entry->unlock();
     if (!entry->isLocked()) {
         ++fUnlockedEntryCount;
-#if GR_DEBUG
+#if GR_CACHE_STATS
         if (fHighWaterUnlockedEntryCount < fUnlockedEntryCount) {
             fHighWaterUnlockedEntryCount = fUnlockedEntryCount;
         }
@@ -472,6 +472,9 @@
 
     GrAssert(fExclusiveList.countEntries() == fClientDetachedCount);
 }
+#endif // GR_DEBUG
+
+#if GR_CACHE_STATS
 
 void GrResourceCache::printStats() const {
     SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);