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

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

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch Created 5 years, 4 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/GrDrawContext.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 16 matching lines...) Expand all
27 #include "SkStrokeRec.h" 27 #include "SkStrokeRec.h"
28 #include "SkTArray.h" 28 #include "SkTArray.h"
29 #include "SkTLazy.h" 29 #include "SkTLazy.h"
30 #include "SkTypes.h" 30 #include "SkTypes.h"
31 #include "SkXfermode.h" 31 #include "SkXfermode.h"
32 32
33 class GrClip; 33 class GrClip;
34 class GrCaps; 34 class GrCaps;
35 class GrPath; 35 class GrPath;
36 class GrPathRange; 36 class GrPathRange;
37 class GrDrawBatch;
37 38
38 class GrDrawTarget : public SkRefCnt { 39 class GrDrawTarget : public SkRefCnt {
39 public: 40 public:
40 41
41 42
42 typedef GrPathRange::PathIndexType PathIndexType; 43 typedef GrPathRange::PathIndexType PathIndexType;
43 typedef GrPathRendering::PathTransformType PathTransformType; 44 typedef GrPathRendering::PathTransformType PathTransformType;
44 45
45 /////////////////////////////////////////////////////////////////////////// 46 ///////////////////////////////////////////////////////////////////////////
46 47
(...skipping 12 matching lines...) Expand all
59 * This plays any queued up draws to its GrGpu target. It also resets this o bject (i.e. flushing 60 * This plays any queued up draws to its GrGpu target. It also resets this o bject (i.e. flushing
60 * is destructive). 61 * is destructive).
61 */ 62 */
62 void flush(); 63 void flush();
63 64
64 /** 65 /**
65 * Gets the capabilities of the draw target. 66 * Gets the capabilities of the draw target.
66 */ 67 */
67 const GrCaps* caps() const { return fCaps; } 68 const GrCaps* caps() const { return fCaps; }
68 69
69 void drawBatch(const GrPipelineBuilder&, GrBatch*); 70 void drawBatch(const GrPipelineBuilder&, GrDrawBatch*);
70 71
71 /** 72 /**
72 * Draws path into the stencil buffer. The fill must be either even/odd or 73 * Draws path into the stencil buffer. The fill must be either even/odd or
73 * winding (not inverse or hairline). It will respect the HW antialias flag 74 * winding (not inverse or hairline). It will respect the HW antialias flag
74 * on the GrPipelineBuilder (if possible in the 3D API). Note, we will neve r have an inverse 75 * on the GrPipelineBuilder (if possible in the 3D API). Note, we will neve r have an inverse
75 * fill with stencil path 76 * fill with stencil path
76 */ 77 */
77 void stencilPath(const GrPipelineBuilder&, const GrPathProcessor*, const GrP ath*, 78 void stencilPath(const GrPipelineBuilder&, const GrPathProcessor*, const GrP ath*,
78 GrPathRendering::FillType); 79 GrPathRendering::FillType);
79 80
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 virtual void purgeResources() {}; 200 virtual void purgeResources() {};
200 201
201 bool programUnitTest(GrContext* owner, int maxStages); 202 bool programUnitTest(GrContext* owner, int maxStages);
202 203
203 struct PipelineInfo { 204 struct PipelineInfo {
204 PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorSt ate* scissor, 205 PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorSt ate* scissor,
205 const GrPrimitiveProcessor* primProc, 206 const GrPrimitiveProcessor* primProc,
206 const SkRect* devBounds, GrDrawTarget* target); 207 const SkRect* devBounds, GrDrawTarget* target);
207 208
208 PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorSt ate* scissor, 209 PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorSt ate* scissor,
209 const GrBatch* batch, const SkRect* devBounds, 210 const GrDrawBatch* batch, const SkRect* devBounds,
210 GrDrawTarget* target); 211 GrDrawTarget* target);
211 212
212 bool valid() const { return SkToBool(fArgs.fPipelineBuilder); } 213 bool valid() const { return SkToBool(fArgs.fPipelineBuilder); }
213 214
214 const GrPipeline::CreateArgs& pipelineCreateArgs() const { 215 const GrPipeline::CreateArgs& pipelineCreateArgs() const {
215 SkASSERT(this->valid()); 216 SkASSERT(this->valid());
216 return fArgs; 217 return fArgs;
217 } 218 }
218 219
219 private: 220 private:
(...skipping 14 matching lines...) Expand all
234 const GrProcOptInfo& colorPOI, 235 const GrProcOptInfo& colorPOI,
235 const GrProcOptInfo& coveragePOI, 236 const GrProcOptInfo& coveragePOI,
236 GrXferProcessor::DstTexture*, 237 GrXferProcessor::DstTexture*,
237 const SkRect* drawBounds); 238 const SkRect* drawBounds);
238 239
239 private: 240 private:
240 virtual void onReset() = 0; 241 virtual void onReset() = 0;
241 242
242 virtual void onFlush() = 0; 243 virtual void onFlush() = 0;
243 244
244 virtual void onDrawBatch(GrBatch*) = 0; 245 virtual void onDrawBatch(GrDrawBatch*) = 0;
245 virtual void onStencilPath(const GrPipelineBuilder&, 246 virtual void onStencilPath(const GrPipelineBuilder&,
246 const GrPathProcessor*, 247 const GrPathProcessor*,
247 const GrPath*, 248 const GrPath*,
248 const GrScissorState&, 249 const GrScissorState&,
249 const GrStencilSettings&) = 0; 250 const GrStencilSettings&) = 0;
250 virtual void onDrawPath(const GrPathProcessor*, 251 virtual void onDrawPath(const GrPathProcessor*,
251 const GrPath*, 252 const GrPath*,
252 const GrStencilSettings&, 253 const GrStencilSettings&,
253 const PipelineInfo&) = 0; 254 const PipelineInfo&) = 0;
254 virtual void onDrawPaths(const GrPathProcessor*, 255 virtual void onDrawPaths(const GrPathProcessor*,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 bool setupClip(const GrPipelineBuilder&, 332 bool setupClip(const GrPipelineBuilder&,
332 GrPipelineBuilder::AutoRestoreFragmentProcessorState*, 333 GrPipelineBuilder::AutoRestoreFragmentProcessorState*,
333 GrPipelineBuilder::AutoRestoreStencil*, 334 GrPipelineBuilder::AutoRestoreStencil*,
334 GrScissorState* scissorState, 335 GrScissorState* scissorState,
335 const SkRect* devBounds) override; 336 const SkRect* devBounds) override;
336 337
337 typedef GrDrawTarget INHERITED; 338 typedef GrDrawTarget INHERITED;
338 }; 339 };
339 340
340 #endif 341 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698