| 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 "GrGLRenderTarget.h" | 8 #include "GrGLRenderTarget.h" |
| 9 | 9 |
| 10 #include "GrGpuGL.h" | 10 #include "GrGpuGL.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 const GrGLIRect& viewport, | 46 const GrGLIRect& viewport, |
| 47 GrGLTexID* texID, | 47 GrGLTexID* texID, |
| 48 GrGLTexture* texture) | 48 GrGLTexture* texture) |
| 49 : INHERITED(gpu, | 49 : INHERITED(gpu, |
| 50 desc.fIsWrapped, | 50 desc.fIsWrapped, |
| 51 texture, | 51 texture, |
| 52 MakeDesc(kNone_GrTextureFlags, | 52 MakeDesc(kNone_GrTextureFlags, |
| 53 viewport.fWidth, viewport.fHeight, | 53 viewport.fWidth, viewport.fHeight, |
| 54 desc.fConfig, desc.fSampleCnt, | 54 desc.fConfig, desc.fSampleCnt, |
| 55 desc.fOrigin)) { | 55 desc.fOrigin)) { |
| 56 SkASSERT(NULL != texID); | 56 SkASSERT(texID); |
| 57 SkASSERT(NULL != texture); | 57 SkASSERT(texture); |
| 58 // FBO 0 can't also be a texture, right? | 58 // FBO 0 can't also be a texture, right? |
| 59 SkASSERT(0 != desc.fRTFBOID); | 59 SkASSERT(0 != desc.fRTFBOID); |
| 60 SkASSERT(0 != desc.fTexFBOID); | 60 SkASSERT(0 != desc.fTexFBOID); |
| 61 | 61 |
| 62 // we assume this is true, TODO: get rid of viewport as a param. | 62 // we assume this is true, TODO: get rid of viewport as a param. |
| 63 SkASSERT(viewport.fWidth == texture->width()); | 63 SkASSERT(viewport.fWidth == texture->width()); |
| 64 SkASSERT(viewport.fHeight == texture->height()); | 64 SkASSERT(viewport.fHeight == texture->height()); |
| 65 | 65 |
| 66 this->init(desc, viewport, texID); | 66 this->init(desc, viewport, texID); |
| 67 } | 67 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 95 fTexFBOID = 0; | 95 fTexFBOID = 0; |
| 96 fMSColorRenderbufferID = 0; | 96 fMSColorRenderbufferID = 0; |
| 97 fTexIDObj.reset(NULL); | 97 fTexIDObj.reset(NULL); |
| 98 INHERITED::onRelease(); | 98 INHERITED::onRelease(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void GrGLRenderTarget::onAbandon() { | 101 void GrGLRenderTarget::onAbandon() { |
| 102 fRTFBOID = 0; | 102 fRTFBOID = 0; |
| 103 fTexFBOID = 0; | 103 fTexFBOID = 0; |
| 104 fMSColorRenderbufferID = 0; | 104 fMSColorRenderbufferID = 0; |
| 105 if (NULL != fTexIDObj.get()) { | 105 if (fTexIDObj.get()) { |
| 106 fTexIDObj->abandon(); | 106 fTexIDObj->abandon(); |
| 107 fTexIDObj.reset(NULL); | 107 fTexIDObj.reset(NULL); |
| 108 } | 108 } |
| 109 INHERITED::onAbandon(); | 109 INHERITED::onAbandon(); |
| 110 } | 110 } |
| OLD | NEW |