Index: src/gpu/GrTexture.cpp |
=================================================================== |
--- src/gpu/GrTexture.cpp (revision 8570) |
+++ src/gpu/GrTexture.cpp (working copy) |
@@ -17,6 +17,12 @@ |
SK_DEFINE_INST_COUNT(GrTexture) |
+GrTexture::~GrTexture() { |
bsalomon
2013/04/09 13:38:27
This was added to the original change.
|
+ if (NULL != fRenderTarget.get()) { |
+ fRenderTarget.get()->owningTextureDestroyed(); |
+ } |
+} |
+ |
/** |
* This method allows us to interrupt the normal deletion process and place |
* textures back in the texture cache when their ref count goes to zero. |
@@ -67,33 +73,15 @@ |
pixelOpsFlags); |
} |
-void GrTexture::releaseRenderTarget() { |
- if (NULL != fRenderTarget) { |
- GrAssert(fRenderTarget->asTexture() == this); |
- GrAssert(fDesc.fFlags & kRenderTarget_GrTextureFlagBit); |
- |
- fRenderTarget->onTextureReleaseRenderTarget(); |
- fRenderTarget->unref(); |
- fRenderTarget = NULL; |
- |
- fDesc.fFlags = fDesc.fFlags & |
- ~(kRenderTarget_GrTextureFlagBit|kNoStencil_GrTextureFlagBit); |
- fDesc.fSampleCnt = 0; |
- } |
-} |
- |
void GrTexture::onRelease() { |
GrAssert(!this->isSetFlag((GrTextureFlags) kReturnToCache_FlagBit)); |
- this->releaseRenderTarget(); |
- |
INHERITED::onRelease(); |
} |
void GrTexture::onAbandon() { |
- if (NULL != fRenderTarget) { |
+ if (NULL != fRenderTarget.get()) { |
fRenderTarget->abandon(); |
} |
- |
INHERITED::onAbandon(); |
} |