Make GrCacheable implement its own ref counting.
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/392333008
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index fb5a8d3..63069a4 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -29,7 +29,7 @@
if (this->impl()->isSetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit) &&
NULL != this->INHERITED::getContext()) {
GrTexture* nonConstThis = const_cast<GrTexture *>(this);
- this->fRefCnt = 1; // restore ref count to initial setting
+ this->ref(); // restore ref count to initial setting
nonConstThis->impl()->resetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit);
nonConstThis->INHERITED::getContext()->addExistingTextureToCache(nonConstThis);
@@ -39,7 +39,6 @@
return;
}
- SkASSERT(0 == this->getDeferredRefCount());
this->INHERITED::internal_dispose();
}