OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrDrawTarget_DEFINED | 8 #ifndef GrDrawTarget_DEFINED |
9 #define GrDrawTarget_DEFINED | 9 #define GrDrawTarget_DEFINED |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 return dt->isSetFlag(GrDrawTarget::kTempMark_Flag); | 189 return dt->isSetFlag(GrDrawTarget::kTempMark_Flag); |
190 } | 190 } |
191 static int NumDependencies(const GrDrawTarget* dt) { | 191 static int NumDependencies(const GrDrawTarget* dt) { |
192 return dt->fDependencies.count(); | 192 return dt->fDependencies.count(); |
193 } | 193 } |
194 static GrDrawTarget* Dependency(GrDrawTarget* dt, int index) { | 194 static GrDrawTarget* Dependency(GrDrawTarget* dt, int index) { |
195 return dt->fDependencies[index]; | 195 return dt->fDependencies[index]; |
196 } | 196 } |
197 }; | 197 }; |
198 | 198 |
199 void recordBatch(GrBatch*); | 199 void recordBatch(GrBatch*, const SkRect& clippedBounds); |
200 void forwardCombine(); | 200 void forwardCombine(); |
201 | 201 |
202 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required | 202 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required |
203 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it | 203 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it |
204 // needs to be accessed by GLPrograms to setup a correct drawstate | 204 // needs to be accessed by GLPrograms to setup a correct drawstate |
205 bool setupDstReadIfNecessary(const GrPipelineBuilder&, | 205 bool setupDstReadIfNecessary(const GrPipelineBuilder&, |
206 GrRenderTarget*, | 206 GrRenderTarget*, |
207 const GrClip&, | 207 const GrClip&, |
208 const GrPipelineOptimizations& optimizations, | 208 const GrPipelineOptimizations& optimizations, |
209 GrXferProcessor::DstTexture*, | 209 GrXferProcessor::DstTexture*, |
210 const SkRect& batchBounds); | 210 const SkRect& batchBounds); |
211 | 211 |
212 void addDependency(GrDrawTarget* dependedOn); | 212 void addDependency(GrDrawTarget* dependedOn); |
213 | 213 |
214 // Used only by drawContextPriv. | 214 // Used only by drawContextPriv. |
215 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); | 215 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); |
216 | 216 |
217 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; | 217 struct RecordedBatch { |
218 sk_sp<GrBatch> fBatch; | |
219 SkRect fClippedBounds; | |
220 }; | |
robertphillips
2016/07/08 15:46:14
line up fRecordedBatches with others
?
bsalomon
2016/07/08 17:06:44
Done.
| |
221 SkSTArray<256, RecordedBatch, true> fRecordedBatches; | |
218 // The context is only in service of the clip mask manager, remove once CMM doesn't need this. | 222 // The context is only in service of the clip mask manager, remove once CMM doesn't need this. |
219 GrContext* fContext; | 223 GrContext* fContext; |
220 GrGpu* fGpu; | 224 GrGpu* fGpu; |
221 GrResourceProvider* fResourceProvider; | 225 GrResourceProvider* fResourceProvider; |
222 GrAuditTrail* fAuditTrail; | 226 GrAuditTrail* fAuditTrail; |
223 | 227 |
224 SkDEBUGCODE(int fDebugID;) | 228 SkDEBUGCODE(int fDebugID;) |
225 uint32_t fFlags; | 229 uint32_t fFlags; |
226 | 230 |
227 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es' | 231 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es' |
228 SkTDArray<GrDrawTarget*> fDependencies; | 232 SkTDArray<GrDrawTarget*> fDependencies; |
229 GrRenderTarget* fRenderTarget; | 233 GrRenderTarget* fRenderTarget; |
230 | 234 |
231 bool fClipBatchToBounds; | 235 bool fClipBatchToBounds; |
232 bool fDrawBatchBounds; | 236 bool fDrawBatchBounds; |
233 int fMaxBatchLookback; | 237 int fMaxBatchLookback; |
234 int fMaxBatchLookahead; | 238 int fMaxBatchLookahead; |
235 | 239 |
236 SkAutoTDelete<gr_instanced::InstancedRendering> fInstancedRendering; | 240 SkAutoTDelete<gr_instanced::InstancedRendering> fInstancedRendering; |
237 | 241 |
238 typedef SkRefCnt INHERITED; | 242 typedef SkRefCnt INHERITED; |
239 }; | 243 }; |
240 | 244 |
241 #endif | 245 #endif |
OLD | NEW |