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 typedef GrTargetCommands::Cmd Cmd; | |
20 | |
21 static GrCommandBuilder* Create(GrGpu* gpu, bool reorder); | |
22 | |
23 virtual ~GrCommandBuilder() {} | |
24 | |
25 void reset() { fCommands.reset(); } | |
26 void flush(GrGpu* gpu, GrResourceProvider* rp) { fCommands.flush(gpu, rp); } | |
27 | |
28 virtual Cmd* recordDrawBatch(GrBatch*, const GrCaps&) = 0; | |
29 | |
30 protected: | |
31 typedef GrTargetCommands::DrawBatch DrawBatch; | |
32 | |
33 GrCommandBuilder() {} | |
34 | |
35 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } | |
36 private: | |
37 GrTargetCommands fCommands; | |
38 | |
39 }; | |
40 | |
41 #endif | |
OLD | NEW |