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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void setLastDrawTarget(GrDrawTarget* dt); | 156 void setLastDrawTarget(GrDrawTarget* dt); |
157 GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; } | 157 GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; } |
158 | 158 |
159 static SampleConfig ComputeSampleConfig(const GrCaps& caps, int sampleCnt); | 159 static SampleConfig ComputeSampleConfig(const GrCaps& caps, int sampleCnt); |
160 | 160 |
161 protected: | 161 protected: |
162 GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, | 162 GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, |
163 SampleConfig sampleConfig, GrStencilAttachment* stencil = nul
lptr) | 163 SampleConfig sampleConfig, GrStencilAttachment* stencil = nul
lptr) |
164 : INHERITED(gpu, desc) | 164 : INHERITED(gpu, desc) |
165 , fStencilAttachment(stencil) | 165 , fStencilAttachment(stencil) |
166 , fMultisampleSpecsID(0) | |
167 , fSampleConfig(sampleConfig) | 166 , fSampleConfig(sampleConfig) |
168 , fLastDrawTarget(nullptr) { | 167 , fLastDrawTarget(nullptr) { |
169 fResolveRect.setLargestInverted(); | 168 fResolveRect.setLargestInverted(); |
170 } | 169 } |
171 | 170 |
172 ~GrRenderTarget() override; | 171 ~GrRenderTarget() override; |
173 | 172 |
174 // override of GrResource | 173 // override of GrResource |
175 void onAbandon() override; | 174 void onAbandon() override; |
176 void onRelease() override; | 175 void onRelease() override; |
177 | 176 |
178 private: | 177 private: |
179 // Allows the backends to perform any additional work that is required for a
ttaching a | 178 // Allows the backends to perform any additional work that is required for a
ttaching a |
180 // GrStencilAttachment. When this is called, the GrStencilAttachment has alr
eady been put onto | 179 // GrStencilAttachment. When this is called, the GrStencilAttachment has alr
eady been put onto |
181 // the GrRenderTarget. This function must return false if any failures occur
when completing the | 180 // the GrRenderTarget. This function must return false if any failures occur
when completing the |
182 // stencil attachment. | 181 // stencil attachment. |
183 virtual bool completeStencilAttachment() = 0; | 182 virtual bool completeStencilAttachment() = 0; |
184 | 183 |
185 friend class GrRenderTargetPriv; | 184 friend class GrRenderTargetPriv; |
186 | 185 |
187 GrStencilAttachment* fStencilAttachment; | 186 GrStencilAttachment* fStencilAttachment; |
188 uint8_t fMultisampleSpecsID; | |
189 SampleConfig fSampleConfig; | 187 SampleConfig fSampleConfig; |
190 | 188 |
191 SkIRect fResolveRect; | 189 SkIRect fResolveRect; |
192 | 190 |
193 // The last drawTarget that wrote to or is currently going to write to this
renderTarget | 191 // The last drawTarget that wrote to or is currently going to write to this
renderTarget |
194 // The drawTarget can be closed (e.g., no draw context is currently bound | 192 // The drawTarget can be closed (e.g., no draw context is currently bound |
195 // to this renderTarget). | 193 // to this renderTarget). |
196 // This back-pointer is required so that we can add a dependancy between | 194 // This back-pointer is required so that we can add a dependancy between |
197 // the drawTarget used to create the current contents of this renderTarget | 195 // the drawTarget used to create the current contents of this renderTarget |
198 // and the drawTarget of a destination renderTarget to which this one is bei
ng drawn. | 196 // and the drawTarget of a destination renderTarget to which this one is bei
ng drawn. |
199 GrDrawTarget* fLastDrawTarget; | 197 GrDrawTarget* fLastDrawTarget; |
200 | 198 |
201 typedef GrSurface INHERITED; | 199 typedef GrSurface INHERITED; |
202 }; | 200 }; |
203 | 201 |
204 | 202 |
205 #endif | 203 #endif |
OLD | NEW |