aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrRenderTarget.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-09 15:04:12 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-09 15:04:12 +0000
commit686bcb871b8425603b9accbf72e27a9309f786d8 (patch)
tree0b1181c0a00e28d30a0f1f54754e1c0c7119c79c /include/gpu/GrRenderTarget.h
parent59dd7162a3d563bf6cf7fab32b0adf166f95d6fd (diff)
Reland of 8525 with fix for case when GrRT outlives GrTexture.
Review URL: https://codereview.chromium.org/13814015 git-svn-id: http://skia.googlecode.com/svn/trunk@8573 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrRenderTarget.h')
-rw-r--r--include/gpu/GrRenderTarget.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index fcb4c3d3b1..2755becc21 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -148,22 +148,18 @@ protected:
fResolveRect.setLargestInverted();
}
- friend class GrTexture;
- // When a texture unrefs an owned render target this func
- // removes the back pointer. This could be called from
- // texture's destructor but would have to be done in derived
- // classes. By the time of texture base destructor it has already
- // lost its pointer to the rt.
- void onTextureReleaseRenderTarget() {
- GrAssert(NULL != fTexture);
- fTexture = NULL;
- }
-
// override of GrResource
virtual void onAbandon() SK_OVERRIDE;
virtual void onRelease() SK_OVERRIDE;
private:
+ friend class GrTexture;
+ // called by ~GrTexture to remove the non-ref'ed back ptr.
+ void owningTextureDestroyed() {
+ GrAssert(NULL != fTexture);
+ fTexture = NULL;
+ }
+
GrStencilBuffer* fStencilBuffer;
GrTexture* fTexture; // not ref'ed