OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrTargetCommands_DEFINED | 8 #ifndef GrTargetCommands_DEFINED |
9 #define GrTargetCommands_DEFINED | 9 #define GrTargetCommands_DEFINED |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 int fMarkerID; | 64 int fMarkerID; |
65 CmdType fType; | 65 CmdType fType; |
66 }; | 66 }; |
67 | 67 |
68 void reset(); | 68 void reset(); |
69 void flush(GrInOrderDrawBuffer*); | 69 void flush(GrInOrderDrawBuffer*); |
70 | 70 |
71 Cmd* recordClearStencilClip(const SkIRect& rect, | 71 Cmd* recordClearStencilClip(const SkIRect& rect, |
72 bool insideClip, | 72 bool insideClip, |
73 GrRenderTarget* renderTarget); | 73 GrRenderTarget* renderTarget); |
74 | |
75 Cmd* recordDiscard(GrRenderTarget*); | 74 Cmd* recordDiscard(GrRenderTarget*); |
76 Cmd* recordDrawBatch(State*, GrBatch*); | 75 Cmd* recordDrawBatch(State*, GrBatch*); |
77 Cmd* recordStencilPath(const GrPipelineBuilder&, | 76 Cmd* recordStencilPath(const GrPipelineBuilder&, |
78 const GrPathProcessor*, | 77 const GrPathProcessor*, |
79 const GrPath*, | 78 const GrPath*, |
80 const GrScissorState&, | 79 const GrScissorState&, |
81 const GrStencilSettings&); | 80 const GrStencilSettings&); |
82 Cmd* recordDrawPath(State*, | 81 Cmd* recordDrawPath(State*, |
83 const GrPathProcessor*, | 82 const GrPathProcessor*, |
84 const GrPath*, | 83 const GrPath*, |
(...skipping 12 matching lines...) Expand all Loading... | |
97 Cmd* recordClear(const SkIRect* rect, | 96 Cmd* recordClear(const SkIRect* rect, |
98 GrColor, | 97 GrColor, |
99 bool canIgnoreRect, | 98 bool canIgnoreRect, |
100 GrRenderTarget*); | 99 GrRenderTarget*); |
101 Cmd* recordCopySurface(GrSurface* dst, | 100 Cmd* recordCopySurface(GrSurface* dst, |
102 GrSurface* src, | 101 GrSurface* src, |
103 const SkIRect& srcRect, | 102 const SkIRect& srcRect, |
104 const SkIPoint& dstPoint); | 103 const SkIPoint& dstPoint); |
105 | 104 |
106 private: | 105 private: |
106 friend class GrCommandBuilder; | |
bsalomon
2015/05/05 15:07:48
:'-(
| |
107 friend class GrInOrderDrawBuffer; | 107 friend class GrInOrderDrawBuffer; |
108 | 108 |
109 typedef GrGpu::DrawArgs DrawArgs; | 109 typedef GrGpu::DrawArgs DrawArgs; |
110 | 110 |
111 void recordXferBarrierIfNecessary(const GrPipeline&, GrInOrderDrawBuffer*); | 111 void recordXferBarrierIfNecessary(const GrPipeline&, GrInOrderDrawBuffer*); |
112 | 112 |
113 // TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere | 113 // TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere |
114 struct State : public SkRefCnt { | 114 struct State : public SkRefCnt { |
115 // TODO get rid of the prim proc parameter when we use batch everywhere | 115 // TODO get rid of the prim proc parameter when we use batch everywhere |
116 State(const GrPrimitiveProcessor* primProc = NULL) | 116 State(const GrPrimitiveProcessor* primProc = NULL) |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 void execute(GrGpu*) override; | 286 void execute(GrGpu*) override; |
287 | 287 |
288 GrXferBarrierType fBarrierType; | 288 GrXferBarrierType fBarrierType; |
289 }; | 289 }; |
290 | 290 |
291 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; | 291 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; |
292 | 292 |
293 typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double. | 293 typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double. |
294 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 294 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
295 | 295 |
296 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } | |
297 GrBatchTarget* batchTarget() { return &fBatchTarget; } | |
298 | |
296 CmdBuffer fCmdBuffer; | 299 CmdBuffer fCmdBuffer; |
297 GrBatchTarget fBatchTarget; | 300 GrBatchTarget fBatchTarget; |
298 }; | 301 }; |
299 | 302 |
300 #endif | 303 #endif |
301 | 304 |
OLD | NEW |