aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLTexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLTexture.cpp')
-rw-r--r--src/gpu/gl/GrGLTexture.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index 6314b0c8f1..aee25bc023 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -22,10 +22,9 @@ void GrGLTexture::init(GrGpuGL* gpu,
fTexParams.invalidate();
fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
- fTexIDObj = SkNEW_ARGS(GrGLTexID,
- (GPUGL->glInterface(),
- textureDesc.fTextureID,
- textureDesc.fIsWrapped));
+ fTexIDObj.reset(SkNEW_ARGS(GrGLTexID, (GPUGL->glInterface(),
+ textureDesc.fTextureID,
+ textureDesc.fIsWrapped)));
if (NULL != rtDesc) {
GrGLIRect vp;
@@ -53,22 +52,19 @@ GrGLTexture::GrGLTexture(GrGpuGL* gpu,
void GrGLTexture::onRelease() {
GPUGL->notifyTextureDelete(this);
- if (NULL != fTexIDObj) {
- fTexIDObj->unref();
- fTexIDObj = NULL;
- }
-
+ fTexIDObj.reset(NULL);
INHERITED::onRelease();
}
void GrGLTexture::onAbandon() {
- if (NULL != fTexIDObj) {
+ if (NULL != fTexIDObj.get()) {
fTexIDObj->abandon();
+ fTexIDObj.reset(NULL);
}
INHERITED::onAbandon();
}
GrBackendObject GrGLTexture::getTextureHandle() const {
- return fTexIDObj->id();
+ return static_cast<GrBackendObject>(this->textureID());
}