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 |
(...skipping 18 matching lines...) Expand all Loading... | |
29 * | 29 * |
30 * Batches are created when GrContext processes a draw call. Batches of the same subclass may be | 30 * Batches are created when GrContext processes a draw call. Batches of the same subclass may be |
31 * merged using combineIfPossible. When two batches merge, one takes on the unio n of the data | 31 * merged using combineIfPossible. When two batches merge, one takes on the unio n of the data |
32 * and the other is left empty. The merged batch becomes responsible for drawing the data from both | 32 * and the other is left empty. The merged batch becomes responsible for drawing the data from both |
33 * the original batches. | 33 * the original batches. |
34 * | 34 * |
35 * If there are any possible optimizations which might require knowing more abou t the full state of | 35 * If there are any possible optimizations which might require knowing more abou t the full state of |
36 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag e, then this | 36 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag e, then this |
37 * information will be communicated to the GrBatch prior to geometry generation. | 37 * information will be communicated to the GrBatch prior to geometry generation. |
38 */ | 38 */ |
39 #define BATCH_SPEW | |
bsalomon
2015/08/06 17:54:12
Since it's in a header, maybe GR_BATCH_SPEW?
Also
| |
40 #ifdef BATCH_SPEW | |
41 #define GrBATCH_INFO(...) SkDebugf(__VA_ARGS__) | |
42 #else | |
43 #define GrBATCH_INFO(...) | |
44 #endif | |
39 | 45 |
40 class GrBatch : public GrNonAtomicRef { | 46 class GrBatch : public GrNonAtomicRef { |
41 public: | 47 public: |
42 GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE( fUsed = false;) } | 48 GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE( fUsed = false;) } |
43 virtual ~GrBatch() {} | 49 virtual ~GrBatch() {} |
44 | 50 |
45 virtual const char* name() const = 0; | 51 virtual const char* name() const = 0; |
46 virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0; | 52 virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0; |
47 virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const = 0; | 53 virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const = 0; |
48 | 54 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 }; | 175 }; |
170 SkAutoTUnref<const GrPipeline> fPipeline; | 176 SkAutoTUnref<const GrPipeline> fPipeline; |
171 static int32_t gCurrBatchClassID; | 177 static int32_t gCurrBatchClassID; |
172 int fNumberOfDraws; | 178 int fNumberOfDraws; |
173 SkDEBUGCODE(bool fUsed;) | 179 SkDEBUGCODE(bool fUsed;) |
174 | 180 |
175 typedef SkRefCnt INHERITED; | 181 typedef SkRefCnt INHERITED; |
176 }; | 182 }; |
177 | 183 |
178 #endif | 184 #endif |
OLD | NEW |