Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/gpu/gl/GrGLTexture.h

Issue 19580003: Fix leak of GrGLTexID when its owning GrGLTexture has been abandoned. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLTexture.h
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index 79cea08663075ead9686497426fde6018dd8a00d..025faded72a0a1213c433785c43e6ed4d7fca38c 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -70,27 +70,27 @@ public:
GrGLTexture(GrGpuGL* gpu,
const Desc& textureDesc);
-
virtual ~GrGLTexture() { this->release(); }
virtual GrBackendObject getTextureHandle() const SK_OVERRIDE;
virtual void invalidateCachedState() SK_OVERRIDE { fTexParams.invalidate(); }
- // these functions
+ // These functions are used to track the texture parameters associated with the texture.
const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const {
*timestamp = fTexParamsTimestamp;
return fTexParams;
}
+
void setCachedTexParams(const TexParams& texParams,
GrGpu::ResetTimestamp timestamp) {
fTexParams = texParams;
fTexParamsTimestamp = timestamp;
}
- GrGLuint textureID() const { return fTexIDObj->id(); }
-protected:
+ GrGLuint textureID() const { return (NULL != fTexIDObj.get()) ? fTexIDObj->id() : 0; }
+protected:
// overrides of GrTexture
virtual void onAbandon() SK_OVERRIDE;
virtual void onRelease() SK_OVERRIDE;
@@ -98,7 +98,7 @@ protected:
private:
TexParams fTexParams;
GrGpu::ResetTimestamp fTexParamsTimestamp;
- GrGLTexID* fTexIDObj;
+ SkAutoTUnref<GrGLTexID> fTexIDObj;
void init(GrGpuGL* gpu,
const Desc& textureDesc,

Powered by Google App Engine
This is Rietveld 408576698