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 GrGpu; |
| 14 class GrResourceProvider; |
| 15 class GrBufferedDrawTarget; |
| 16 |
| 17 class GrCommandBuilder : ::SkNoncopyable { |
| 18 public: |
| 19 bool empty() const { return fCommands.empty(); } |
| 20 typedef GrTargetCommands::Cmd Cmd; |
| 21 typedef GrTargetCommands::StateForPathDraw State; |
| 22 |
| 23 static GrCommandBuilder* Create(GrFoo* foo, GrGpu* gpu, bool reorder, GrRend
erTarget* dst); |
| 24 |
| 25 virtual ~GrCommandBuilder() {} |
| 26 |
| 27 void reset() { fCommands.reset(); } |
| 28 void flush(GrGpu* gpu, GrResourceProvider* rp) { fCommands.flush(gpu, rp); } |
| 29 |
| 30 virtual Cmd* recordDrawBatch(GrBatch*, const GrCaps&) = 0; |
| 31 virtual Cmd* recordDrawPaths(State*, |
| 32 GrBufferedDrawTarget*, |
| 33 const GrPathProcessor*, |
| 34 const GrPathRange*, |
| 35 const void*, |
| 36 GrDrawTarget::PathIndexType, |
| 37 const float transformValues[], |
| 38 GrDrawTarget::PathTransformType , |
| 39 int, |
| 40 const GrStencilSettings&, |
| 41 const GrPipelineOptimizations&) = 0; |
| 42 |
| 43 protected: |
| 44 typedef GrTargetCommands::DrawBatch DrawBatch; |
| 45 typedef GrTargetCommands::DrawPath DrawPath; |
| 46 typedef GrTargetCommands::DrawPaths DrawPaths; |
| 47 |
| 48 GrCommandBuilder(GrFoo* foo, GrGpu* gpu, GrRenderTarget* dst) : fCommands(fo
o, gpu, dst) {} |
| 49 |
| 50 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } |
| 51 private: |
| 52 GrTargetCommands fCommands; |
| 53 |
| 54 }; |
| 55 |
| 56 #endif |
OLD | NEW |