Scratch textures are no longer removed from the cache in Debug
http://codereview.appspot.com/6465079/
git-svn-id: http://skia.googlecode.com/svn/trunk@5221 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 077493f..9fb47e5 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -179,17 +179,6 @@
void unlockTexture(GrTexture* texture);
/**
- * Free any data associated with the provided entry in the texture cache.
- * Currently this entry point is only used when a scratch texture is
- * detached from the cache. In this case the GrResourceEntry* associated
- * with the texture needs to be freed since it will be re-allocated when
- * the texture is re-added. This entry point will be removed soon since the
- * texture can now carry around a pointer to its GrResourceEntry* (and
- * will eventually take over its functionality).
- */
- void freeEntry(GrTexture* texture);
-
- /**
* Creates a texture that is outside the cache. Does not count against
* cache's budget.
*/
@@ -858,9 +847,10 @@
GrTexture* detach() {
GrTexture* temp = fTexture;
- // freeEntry will remove the texture cache's ref
- temp->ref();
- fContext->freeEntry(fTexture);
+ // Conceptually the texture's cache entry loses its ref to the
+ // texture while the caller of this method gets a ref.
+ GrAssert(NULL != temp->getCacheEntry());
+
fTexture = NULL;
temp->setFlag((GrTextureFlags) GrTexture::kReturnToCache_FlagBit);