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