| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 if (NULL != rtDesc) { | 27 if (NULL != rtDesc) { |
| 28 GrGLIRect vp; | 28 GrGLIRect vp; |
| 29 vp.fLeft = 0; | 29 vp.fLeft = 0; |
| 30 vp.fWidth = textureDesc.fWidth; | 30 vp.fWidth = textureDesc.fWidth; |
| 31 vp.fBottom = 0; | 31 vp.fBottom = 0; |
| 32 vp.fHeight = textureDesc.fHeight; | 32 vp.fHeight = textureDesc.fHeight; |
| 33 | 33 |
| 34 fRenderTarget.reset(SkNEW_ARGS(GrGLRenderTarget, (gpu, *rtDesc, vp, fTex
IDObj, this))); | 34 fRenderTarget.reset(SkNEW_ARGS(GrGLRenderTarget, (gpu, *rtDesc, vp, fTex
IDObj, this))); |
| 35 } | 35 } |
| 36 this->registerWithCache(); | |
| 37 } | 36 } |
| 38 | 37 |
| 39 GrGLTexture::GrGLTexture(GrGpuGL* gpu, | 38 GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
| 40 const Desc& textureDesc) | 39 const Desc& textureDesc) |
| 41 : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { | 40 : INHERITED(gpu, textureDesc.fIsWrapped, textureDesc) { |
| 42 this->init(gpu, textureDesc, NULL); | 41 this->init(gpu, textureDesc, NULL); |
| 43 } | 42 } |
| 44 | 43 |
| 45 GrGLTexture::GrGLTexture(GrGpuGL* gpu, | 44 GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
| 46 const Desc& textureDesc, | 45 const Desc& textureDesc, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 |