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

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

Issue 1966903004: Remove clip from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@fix2_nvpr
Patch Set: Created 4 years, 7 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 * Together these two functions flush all queued up draws to the Gpu. 98 * Together these two functions flush all queued up draws to the Gpu.
99 */ 99 */
100 void prepareBatches(GrBatchFlushState* flushState); 100 void prepareBatches(GrBatchFlushState* flushState);
101 void drawBatches(GrBatchFlushState* flushState); 101 void drawBatches(GrBatchFlushState* flushState);
102 102
103 /** 103 /**
104 * Gets the capabilities of the draw target. 104 * Gets the capabilities of the draw target.
105 */ 105 */
106 const GrCaps* caps() const { return fGpu->caps(); } 106 const GrCaps* caps() const { return fGpu->caps(); }
107 107
108 void drawBatch(const GrPipelineBuilder&, GrDrawBatch*, const SkIRect* scisso rRect = nullptr); 108 void drawBatch(const GrPipelineBuilder&, const GrClip&, GrDrawBatch*);
109 109
110 /** 110 /**
111 * Draws path into the stencil buffer. The fill must be either even/odd or 111 * Draws path into the stencil buffer. The fill must be either even/odd or
112 * winding (not inverse or hairline). It will respect the HW antialias flag 112 * winding (not inverse or hairline). It will respect the HW antialias flag
113 * on the GrPipelineBuilder (if possible in the 3D API). Note, we will neve r have an inverse 113 * on the GrPipelineBuilder (if possible in the 3D API). Note, we will neve r have an inverse
114 * fill with stencil path 114 * fill with stencil path
115 */ 115 */
116 void stencilPath(const GrPipelineBuilder&, const SkMatrix& viewMatrix, const GrPath*, 116 void stencilPath(const GrPipelineBuilder&, const GrClip&, const SkMatrix& vi ewMatrix,
117 GrPathRendering::FillType); 117 const GrPath*, GrPathRendering::FillType);
118 118
119 /** 119 /**
120 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole 120 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole
121 * thing if rect is nullptr, otherwise just the rect. If canIgnoreRect is se t then the entire 121 * thing if rect is nullptr, otherwise just the rect. If canIgnoreRect is se t then the entire
122 * render target can be optionally cleared. 122 * render target can be optionally cleared.
123 */ 123 */
124 void clear(const SkIRect* rect, 124 void clear(const SkIRect* rect,
125 GrColor color, 125 GrColor color,
126 bool canIgnoreRect, 126 bool canIgnoreRect,
127 GrRenderTarget* renderTarget); 127 GrRenderTarget* renderTarget);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 }; 211 };
212 212
213 void recordBatch(GrBatch*); 213 void recordBatch(GrBatch*);
214 void forwardCombine(); 214 void forwardCombine();
215 215
216 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required 216 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required
217 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it 217 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it
218 // needs to be accessed by GLPrograms to setup a correct drawstate 218 // needs to be accessed by GLPrograms to setup a correct drawstate
219 bool setupDstReadIfNecessary(const GrPipelineBuilder&, 219 bool setupDstReadIfNecessary(const GrPipelineBuilder&,
220 const GrClip&,
220 const GrPipelineOptimizations& optimizations, 221 const GrPipelineOptimizations& optimizations,
221 GrXferProcessor::DstTexture*, 222 GrXferProcessor::DstTexture*,
222 const SkRect& batchBounds); 223 const SkRect& batchBounds);
223 224
224 void addDependency(GrDrawTarget* dependedOn); 225 void addDependency(GrDrawTarget* dependedOn);
225 226
226 // Used only by CMM. 227 // Used only by CMM.
227 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); 228 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*);
228 229
229 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; 230 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches;
230 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; 231 SkAutoTDelete<GrClipMaskManager> fClipMaskManager;
231 // The context is only in service of the clip mask manager, remove once CMM doesn't need this. 232 // The context is only in service of the clip mask manager, remove once CMM doesn't need this.
232 GrContext* fContext; 233 GrContext* fContext;
233 GrGpu* fGpu; 234 GrGpu* fGpu;
234 GrResourceProvider* fResourceProvider; 235 GrResourceProvider* fResourceProvider;
235 GrAuditTrail* fAuditTrail; 236 GrAuditTrail* fAuditTrail;
236 237
237 SkDEBUGCODE(int fDebugID;) 238 SkDEBUGCODE(int fDebugID;)
238 uint32_t fFlags; 239 uint32_t fFlags;
239 240
240 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es' 241 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es'
241 SkTDArray<GrDrawTarget*> fDependencies; 242 SkTDArray<GrDrawTarget*> fDependencies;
242 GrRenderTarget* fRenderTarget; 243 GrRenderTarget* fRenderTarget;
243 244
245 bool fClipBatchToBounds;
244 bool fDrawBatchBounds; 246 bool fDrawBatchBounds;
245 int fMaxBatchLookback; 247 int fMaxBatchLookback;
246 int fMaxBatchLookahead; 248 int fMaxBatchLookahead;
247 249
248 typedef SkRefCnt INHERITED; 250 typedef SkRefCnt INHERITED;
249 }; 251 };
250 252
251 #endif 253 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContextPriv.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | src/gpu/GrDrawTarget.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698