| 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 GrBufferedDrawTarget; | 13 class GrGpu; |
| 14 class GrResourceProvider; |
| 14 | 15 |
| 15 class GrCommandBuilder : ::SkNoncopyable { | 16 class GrCommandBuilder : ::SkNoncopyable { |
| 16 public: | 17 public: |
| 17 typedef GrTargetCommands::Cmd Cmd; | 18 typedef GrTargetCommands::Cmd Cmd; |
| 18 typedef GrTargetCommands::StateForPathDraw State; | 19 typedef GrTargetCommands::StateForPathDraw State; |
| 19 | 20 |
| 20 static GrCommandBuilder* Create(GrGpu* gpu, bool reorder); | 21 static GrCommandBuilder* Create(GrGpu* gpu, bool reorder); |
| 21 | 22 |
| 22 virtual ~GrCommandBuilder() {} | 23 virtual ~GrCommandBuilder() {} |
| 23 | 24 |
| 24 void reset() { fCommands.reset(); } | 25 void reset() { fCommands.reset(); } |
| 25 void flush(GrBufferedDrawTarget* bufferedDrawTarget) { fCommands.flush(buffe
redDrawTarget); } | 26 void flush(GrGpu* gpu, GrResourceProvider* rp) { fCommands.flush(gpu, rp); } |
| 26 | 27 |
| 27 virtual Cmd* recordClearStencilClip(const SkIRect& rect, | 28 virtual Cmd* recordClearStencilClip(const SkIRect& rect, |
| 28 bool insideClip, | 29 bool insideClip, |
| 29 GrRenderTarget* renderTarget); | 30 GrRenderTarget* renderTarget); |
| 30 virtual Cmd* recordDiscard(GrRenderTarget*); | 31 virtual Cmd* recordDiscard(GrRenderTarget*); |
| 31 virtual Cmd* recordDrawBatch(GrDrawBatch*, const GrCaps&) = 0; | 32 virtual Cmd* recordDrawBatch(GrDrawBatch*, const GrCaps&) = 0; |
| 32 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, | 33 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, |
| 33 const GrPathProcessor*, | 34 const GrPathProcessor*, |
| 34 const GrPath*, | 35 const GrPath*, |
| 35 const GrScissorState&, | 36 const GrScissorState&, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 | 60 |
| 60 protected: | 61 protected: |
| 61 typedef GrTargetCommands::DrawBatch DrawBatch; | 62 typedef GrTargetCommands::DrawBatch DrawBatch; |
| 62 typedef GrTargetCommands::StencilPath StencilPath; | 63 typedef GrTargetCommands::StencilPath StencilPath; |
| 63 typedef GrTargetCommands::DrawPath DrawPath; | 64 typedef GrTargetCommands::DrawPath DrawPath; |
| 64 typedef GrTargetCommands::DrawPaths DrawPaths; | 65 typedef GrTargetCommands::DrawPaths DrawPaths; |
| 65 typedef GrTargetCommands::Clear Clear; | 66 typedef GrTargetCommands::Clear Clear; |
| 66 typedef GrTargetCommands::ClearStencilClip ClearStencilClip; | 67 typedef GrTargetCommands::ClearStencilClip ClearStencilClip; |
| 67 typedef GrTargetCommands::CopySurface CopySurface; | 68 typedef GrTargetCommands::CopySurface CopySurface; |
| 68 | 69 |
| 69 GrCommandBuilder(GrGpu* gpu) : fCommands(gpu) {} | 70 GrCommandBuilder() {} |
| 70 | 71 |
| 71 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } | 72 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } |
| 72 GrBatchTarget* batchTarget() { return fCommands.batchTarget(); } | |
| 73 | |
| 74 private: | 73 private: |
| 75 GrTargetCommands fCommands; | 74 GrTargetCommands fCommands; |
| 76 | 75 |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 #endif | 78 #endif |
| OLD | NEW |