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, |