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