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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const GrGLIRect& viewport, | 45 const GrGLIRect& viewport, |
46 GrGLTexID* texID, | 46 GrGLTexID* texID, |
47 GrGLTexture* texture) | 47 GrGLTexture* texture) |
48 : INHERITED(gpu, | 48 : INHERITED(gpu, |
49 desc.fIsWrapped, | 49 desc.fIsWrapped, |
50 texture, | 50 texture, |
51 MakeDesc(kNone_GrTextureFlags, | 51 MakeDesc(kNone_GrTextureFlags, |
52 viewport.fWidth, viewport.fHeight, | 52 viewport.fWidth, viewport.fHeight, |
53 desc.fConfig, desc.fSampleCnt, | 53 desc.fConfig, desc.fSampleCnt, |
54 desc.fOrigin)) { | 54 desc.fOrigin)) { |
55 GrAssert(NULL != texID); | 55 SkASSERT(NULL != texID); |
56 GrAssert(NULL != texture); | 56 SkASSERT(NULL != texture); |
57 // FBO 0 can't also be a texture, right? | 57 // FBO 0 can't also be a texture, right? |
58 GrAssert(0 != desc.fRTFBOID); | 58 SkASSERT(0 != desc.fRTFBOID); |
59 GrAssert(0 != desc.fTexFBOID); | 59 SkASSERT(0 != desc.fTexFBOID); |
60 | 60 |
61 // we assume this is true, TODO: get rid of viewport as a param. | 61 // we assume this is true, TODO: get rid of viewport as a param. |
62 GrAssert(viewport.fWidth == texture->width()); | 62 SkASSERT(viewport.fWidth == texture->width()); |
63 GrAssert(viewport.fHeight == texture->height()); | 63 SkASSERT(viewport.fHeight == texture->height()); |
64 | 64 |
65 this->init(desc, viewport, texID); | 65 this->init(desc, viewport, texID); |
66 } | 66 } |
67 | 67 |
68 GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu, | 68 GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu, |
69 const Desc& desc, | 69 const Desc& desc, |
70 const GrGLIRect& viewport) | 70 const GrGLIRect& viewport) |
71 : INHERITED(gpu, | 71 : INHERITED(gpu, |
72 desc.fIsWrapped, | 72 desc.fIsWrapped, |
73 NULL, | 73 NULL, |
(...skipping 27 matching lines...) Expand all Loading... |
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 (NULL != 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 |