OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrCommandBuilder_DEFINED |
| 9 #define GrCommandBuilder_DEFINED |
| 10 |
| 11 #include "GrTargetCommands.h" |
| 12 |
| 13 class GrInOrderDrawBuffer; |
| 14 class GrVertexBufferAllocPool; |
| 15 class GrIndexBufferAllocPool; |
| 16 |
| 17 class GrCommandBuilder : ::SkNoncopyable { |
| 18 public: |
| 19 typedef GrTargetCommands::Cmd Cmd; |
| 20 typedef GrTargetCommands::State State; |
| 21 |
| 22 GrCommandBuilder(GrGpu* gpu, |
| 23 GrVertexBufferAllocPool* vertexPool, |
| 24 GrIndexBufferAllocPool* indexPool) |
| 25 : fCommands(gpu, vertexPool, indexPool) { |
| 26 } |
| 27 |
| 28 virtual ~GrCommandBuilder() {} |
| 29 |
| 30 void reset() { fCommands.reset(); } |
| 31 void flush(GrInOrderDrawBuffer* iodb) { fCommands.flush(iodb); } |
| 32 |
| 33 virtual Cmd* recordClearStencilClip(const SkIRect& rect, |
| 34 bool insideClip, |
| 35 GrRenderTarget* renderTarget); |
| 36 virtual Cmd* recordDiscard(GrRenderTarget*); |
| 37 virtual Cmd* recordDrawBatch(State*, GrBatch*); |
| 38 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, |
| 39 const GrPathProcessor*, |
| 40 const GrPath*, |
| 41 const GrScissorState&, |
| 42 const GrStencilSettings&); |
| 43 virtual Cmd* recordDrawPath(State*, |
| 44 const GrPathProcessor*, |
| 45 const GrPath*, |
| 46 const GrStencilSettings&); |
| 47 virtual Cmd* recordDrawPaths(State*, |
| 48 GrInOrderDrawBuffer*, |
| 49 const GrPathProcessor*, |
| 50 const GrPathRange*, |
| 51 const void*, |
| 52 GrDrawTarget::PathIndexType, |
| 53 const float transformValues[], |
| 54 GrDrawTarget::PathTransformType , |
| 55 int, |
| 56 const GrStencilSettings&, |
| 57 const GrDrawTarget::PipelineInfo&); |
| 58 virtual Cmd* recordClear(const SkIRect* rect, |
| 59 GrColor, |
| 60 bool canIgnoreRect, |
| 61 GrRenderTarget*); |
| 62 virtual Cmd* recordCopySurface(GrSurface* dst, |
| 63 GrSurface* src, |
| 64 const SkIRect& srcRect, |
| 65 const SkIPoint& dstPoint); |
| 66 virtual Cmd* recordXferBarrierIfNecessary(const GrPipeline&, const GrDrawTar
getCaps&); |
| 67 |
| 68 private: |
| 69 typedef GrTargetCommands::DrawBatch DrawBatch; |
| 70 typedef GrTargetCommands::StencilPath StencilPath; |
| 71 typedef GrTargetCommands::DrawPath DrawPath; |
| 72 typedef GrTargetCommands::DrawPaths DrawPaths; |
| 73 typedef GrTargetCommands::Clear Clear; |
| 74 typedef GrTargetCommands::ClearStencilClip ClearStencilClip; |
| 75 typedef GrTargetCommands::CopySurface CopySurface; |
| 76 typedef GrTargetCommands::XferBarrier XferBarrier; |
| 77 |
| 78 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } |
| 79 GrBatchTarget* batchTarget() { return fCommands.batchTarget(); } |
| 80 |
| 81 GrTargetCommands fCommands; |
| 82 |
| 83 }; |
| 84 |
| 85 #endif |
OLD | NEW |