Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: include/gpu/GrRenderTarget.h

Issue 13414006: Remove GrTexture::releaseRenderTarget() and add GrSurface::isSameAs(). (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gyp/tests.gyp ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « gyp/tests.gyp ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698