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 GrBatch_DEFINED | 8 #ifndef GrBatch_DEFINED |
9 #define GrBatch_DEFINED | 9 #define GrBatch_DEFINED |
10 | 10 |
11 #include <new> | 11 #include <new> |
12 // TODO remove this header when we move entirely to batch | 12 // TODO remove this header when we move entirely to batch |
| 13 #include "GrDrawTarget.h" |
13 #include "GrGeometryProcessor.h" | 14 #include "GrGeometryProcessor.h" |
14 #include "SkRefCnt.h" | 15 #include "SkRefCnt.h" |
15 #include "SkThread.h" | 16 #include "SkThread.h" |
16 #include "SkTypes.h" | 17 #include "SkTypes.h" |
17 | 18 |
18 class GrBatchTarget; | 19 class GrBatchTarget; |
19 class GrGpu; | 20 class GrGpu; |
20 class GrIndexBufferAllocPool; | 21 class GrIndexBufferAllocPool; |
21 class GrPipeline; | 22 class GrPipeline; |
22 class GrVertexBufferAllocPool; | 23 class GrVertexBufferAllocPool; |
(...skipping 12 matching lines...) Expand all Loading... |
35 * the original batches. | 36 * the original batches. |
36 * | 37 * |
37 * If there are any possible optimizations which might require knowing more abou
t the full state of | 38 * If there are any possible optimizations which might require knowing more abou
t the full state of |
38 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag
e, then this | 39 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag
e, then this |
39 * information will be communicated to the GrBatch prior to geometry generation. | 40 * information will be communicated to the GrBatch prior to geometry generation. |
40 */ | 41 */ |
41 | 42 |
42 class GrBatch : public SkRefCnt { | 43 class GrBatch : public SkRefCnt { |
43 public: | 44 public: |
44 SK_DECLARE_INST_COUNT(GrBatch) | 45 SK_DECLARE_INST_COUNT(GrBatch) |
45 GrBatch() : fNumberOfDraws(0) { SkDEBUGCODE(fUsed = false;) } | 46 GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE(
fUsed = false;) } |
46 virtual ~GrBatch() {} | 47 virtual ~GrBatch() {} |
47 | 48 |
48 virtual const char* name() const = 0; | 49 virtual const char* name() const = 0; |
49 virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0; | 50 virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0; |
50 virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const =
0; | 51 virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const =
0; |
51 | 52 |
52 /* | 53 /* |
53 * initBatchTracker is a hook for the some additional overrides / optimizati
on possibilities | 54 * initBatchTracker is a hook for the some additional overrides / optimizati
on possibilities |
54 * from the GrXferProcessor. | 55 * from the GrXferProcessor. |
55 */ | 56 */ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 static int32_t gCurrBatchClassID; | 122 static int32_t gCurrBatchClassID; |
122 | 123 |
123 SkDEBUGCODE(bool fUsed;) | 124 SkDEBUGCODE(bool fUsed;) |
124 | 125 |
125 int fNumberOfDraws; | 126 int fNumberOfDraws; |
126 | 127 |
127 typedef SkRefCnt INHERITED; | 128 typedef SkRefCnt INHERITED; |
128 }; | 129 }; |
129 | 130 |
130 #endif | 131 #endif |
OLD | NEW |