| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrGLTexture.h" | 8 #include "GrGLTexture.h" |
| 9 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 GrGLTexture::GrGLTexture(GrGpuGL* gpu, | 44 GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
| 45 const Desc& textureDesc, | 45 const Desc& textureDesc, |
| 46 const GrGLRenderTarget::Desc& rtDesc) | 46 const GrGLRenderTarget::Desc& rtDesc) |
| 47 : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { | 47 : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { |
| 48 this->init(gpu, textureDesc, &rtDesc); | 48 this->init(gpu, textureDesc, &rtDesc); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void GrGLTexture::onRelease() { | 51 void GrGLTexture::onRelease() { |
| 52 GPUGL->notifyTextureDelete(this); | |
| 53 fTexIDObj.reset(NULL); | 52 fTexIDObj.reset(NULL); |
| 54 INHERITED::onRelease(); | 53 INHERITED::onRelease(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 void GrGLTexture::onAbandon() { | 56 void GrGLTexture::onAbandon() { |
| 58 if (NULL != fTexIDObj.get()) { | 57 if (NULL != fTexIDObj.get()) { |
| 59 fTexIDObj->abandon(); | 58 fTexIDObj->abandon(); |
| 60 fTexIDObj.reset(NULL); | 59 fTexIDObj.reset(NULL); |
| 61 } | 60 } |
| 62 | 61 |
| 63 INHERITED::onAbandon(); | 62 INHERITED::onAbandon(); |
| 64 } | 63 } |
| 65 | 64 |
| 66 GrBackendObject GrGLTexture::getTextureHandle() const { | 65 GrBackendObject GrGLTexture::getTextureHandle() const { |
| 67 return static_cast<GrBackendObject>(this->textureID()); | 66 return static_cast<GrBackendObject>(this->textureID()); |
| 68 } | 67 } |
| OLD | NEW |