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 #ifndef GrRenderTarget_DEFINED | 8 #ifndef GrRenderTarget_DEFINED |
9 #define GrRenderTarget_DEFINED | 9 #define GrRenderTarget_DEFINED |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 bool isWrapped, | 142 bool isWrapped, |
143 GrTexture* texture, | 143 GrTexture* texture, |
144 const GrTextureDesc& desc) | 144 const GrTextureDesc& desc) |
145 : INHERITED(gpu, isWrapped, desc) | 145 : INHERITED(gpu, isWrapped, desc) |
146 , fStencilBuffer(NULL) | 146 , fStencilBuffer(NULL) |
147 , fTexture(texture) { | 147 , fTexture(texture) { |
148 fResolveRect.setLargestInverted(); | 148 fResolveRect.setLargestInverted(); |
149 } | 149 } |
150 | 150 |
151 friend class GrTexture; | 151 friend class GrTexture; |
152 // When a texture unrefs an owned render target this func | |
153 // removes the back pointer. This could be called from | |
154 // texture's destructor but would have to be done in derived | |
155 // classes. By the time of texture base destructor it has already | |
156 // lost its pointer to the rt. | |
157 void onTextureReleaseRenderTarget() { | |
158 GrAssert(NULL != fTexture); | |
159 fTexture = NULL; | |
160 } | |
161 | 152 |
162 // override of GrResource | 153 // override of GrResource |
163 virtual void onAbandon() SK_OVERRIDE; | 154 virtual void onAbandon() SK_OVERRIDE; |
164 virtual void onRelease() SK_OVERRIDE; | 155 virtual void onRelease() SK_OVERRIDE; |
165 | 156 |
166 private: | 157 private: |
167 GrStencilBuffer* fStencilBuffer; | 158 GrStencilBuffer* fStencilBuffer; |
168 GrTexture* fTexture; // not ref'ed | 159 GrTexture* fTexture; // not ref'ed |
169 | 160 |
170 GrIRect fResolveRect; | 161 GrIRect fResolveRect; |
171 | 162 |
172 typedef GrSurface INHERITED; | 163 typedef GrSurface INHERITED; |
173 }; | 164 }; |
174 | 165 |
175 #endif | 166 #endif |
OLD | NEW |