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* recordClearStencilClip(const SkIRect& rect, | |
30 bool insideClip, | |
31 GrRenderTarget* renderTarget); | |
32 virtual Cmd* recordDrawBatch(GrBatch*, const GrCaps&) = 0; | 29 virtual Cmd* recordDrawBatch(GrBatch*, const GrCaps&) = 0; |
33 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, | 30 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, |
34 const GrPathProcessor*, | 31 const GrPathProcessor*, |
35 const GrPath*, | 32 const GrPath*, |
36 const GrScissorState&, | 33 const GrScissorState&, |
37 const GrStencilSettings&) = 0; | 34 const GrStencilSettings&) = 0; |
38 virtual Cmd* recordDrawPath(State*, | 35 virtual Cmd* recordDrawPath(State*, |
39 const GrPathProcessor*, | 36 const GrPathProcessor*, |
40 const GrPath*, | 37 const GrPath*, |
41 const GrStencilSettings&) = 0; | 38 const GrStencilSettings&) = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
53 virtual Cmd* recordCopySurface(GrSurface* dst, | 50 virtual Cmd* recordCopySurface(GrSurface* dst, |
54 GrSurface* src, | 51 GrSurface* src, |
55 const SkIRect& srcRect, | 52 const SkIRect& srcRect, |
56 const SkIPoint& dstPoint); | 53 const SkIPoint& dstPoint); |
57 | 54 |
58 protected: | 55 protected: |
59 typedef GrTargetCommands::DrawBatch DrawBatch; | 56 typedef GrTargetCommands::DrawBatch DrawBatch; |
60 typedef GrTargetCommands::StencilPath StencilPath; | 57 typedef GrTargetCommands::StencilPath StencilPath; |
61 typedef GrTargetCommands::DrawPath DrawPath; | 58 typedef GrTargetCommands::DrawPath DrawPath; |
62 typedef GrTargetCommands::DrawPaths DrawPaths; | 59 typedef GrTargetCommands::DrawPaths DrawPaths; |
63 typedef GrTargetCommands::ClearStencilClip ClearStencilClip; | |
64 typedef GrTargetCommands::CopySurface CopySurface; | 60 typedef GrTargetCommands::CopySurface CopySurface; |
65 | 61 |
66 GrCommandBuilder() {} | 62 GrCommandBuilder() {} |
67 | 63 |
68 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } | 64 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } |
69 private: | 65 private: |
70 GrTargetCommands fCommands; | 66 GrTargetCommands fCommands; |
71 | 67 |
72 }; | 68 }; |
73 | 69 |
74 #endif | 70 #endif |
OLD | NEW |