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