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

Side by Side Diff: src/gpu/GrDrawTarget.h

Issue 2137543002: Use clipped bounds for reordering decisions (Closed) Base URL: https://chromium.googlesource.com/skia.git@lessstencil
Patch Set: fix windows warning Created 4 years, 5 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
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('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 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
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 };
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
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698