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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 /** | 128 /** |
129 * GrStencilBuffer is not part of the public API. | 129 * GrStencilBuffer is not part of the public API. |
130 */ | 130 */ |
131 GrStencilBuffer* getStencilBuffer() const { return fStencilBuffer; } | 131 GrStencilBuffer* getStencilBuffer() const { return fStencilBuffer; } |
132 void setStencilBuffer(GrStencilBuffer* stencilBuffer); | 132 void setStencilBuffer(GrStencilBuffer* stencilBuffer); |
133 | 133 |
134 protected: | 134 protected: |
135 GrRenderTarget(GrGpu* gpu, | 135 GrRenderTarget(GrGpu* gpu, |
136 bool isWrapped, | 136 bool isWrapped, |
137 GrTexture* texture, | 137 GrTexture* texture, |
138 const GrTextureDesc& desc) | 138 const GrSurfaceDesc& desc) |
139 : INHERITED(gpu, isWrapped, desc) | 139 : INHERITED(gpu, isWrapped, desc) |
140 , fStencilBuffer(NULL) | 140 , fStencilBuffer(NULL) |
141 , fTexture(texture) { | 141 , fTexture(texture) { |
142 fResolveRect.setLargestInverted(); | 142 fResolveRect.setLargestInverted(); |
143 } | 143 } |
144 | 144 |
145 // override of GrResource | 145 // override of GrResource |
146 virtual void onAbandon() SK_OVERRIDE; | 146 virtual void onAbandon() SK_OVERRIDE; |
147 virtual void onRelease() SK_OVERRIDE; | 147 virtual void onRelease() SK_OVERRIDE; |
148 | 148 |
149 private: | 149 private: |
150 friend class GrTexture; | 150 friend class GrTexture; |
151 // called by ~GrTexture to remove the non-ref'ed back ptr. | 151 // called by ~GrTexture to remove the non-ref'ed back ptr. |
152 void owningTextureDestroyed() { | 152 void owningTextureDestroyed() { |
153 SkASSERT(fTexture); | 153 SkASSERT(fTexture); |
154 fTexture = NULL; | 154 fTexture = NULL; |
155 } | 155 } |
156 | 156 |
157 GrStencilBuffer* fStencilBuffer; | 157 GrStencilBuffer* fStencilBuffer; |
158 GrTexture* fTexture; // not ref'ed | 158 GrTexture* fTexture; // not ref'ed |
159 | 159 |
160 SkIRect fResolveRect; | 160 SkIRect fResolveRect; |
161 | 161 |
162 typedef GrSurface INHERITED; | 162 typedef GrSurface INHERITED; |
163 }; | 163 }; |
164 | 164 |
165 #endif | 165 #endif |
OLD | NEW |