Remove incorrect GrAssert calls in GrResourceCache::removeAll
The asserts in GrResourceCache are too aggressive, and assume that all resources are always purged. Locked resources will not be purged.
BUG=114861
Review URL: https://codereview.appspot.com/5674096
git-svn-id: http://skia.googlecode.com/svn/trunk@3226 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index afbe9b3..ba6452d 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -304,14 +304,18 @@
fMaxCount = 0;
this->purgeAsNeeded();
- GrAssert(!fCache.count());
+#if GR_DEBUG
GrAssert(!fUnlockedEntryCount);
- // Items may have been detached from the cache (such as the backing texture
- // for an SkGpuDevice). The above purge would not have removed them.
- GrAssert(fEntryCount == fClientDetachedCount);
- GrAssert(fEntryBytes == fClientDetachedBytes);
- GrAssert(NULL == fHead);
- GrAssert(NULL == fTail);
+ if (!fCache.count()) {
+ // Items may have been detached from the cache (such as the backing
+ // texture for an SkGpuDevice). The above purge would not have removed
+ // them.
+ GrAssert(fEntryCount == fClientDetachedCount);
+ GrAssert(fEntryBytes == fClientDetachedBytes);
+ GrAssert(NULL == fHead);
+ GrAssert(NULL == fTail);
+ }
+#endif
fMaxBytes = savedMaxBytes;
fMaxCount = savedMaxCount;