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 13 matching lines...) Expand all Loading... |
24 * subclasses complete freedom to decide how / what they can batch. | 24 * subclasses complete freedom to decide how / what they can batch. |
25 * | 25 * |
26 * Batches are created when GrContext processes a draw call. Batches of the same
subclass may be | 26 * Batches are created when GrContext processes a draw call. Batches of the same
subclass may be |
27 * merged using combineIfPossible. When two batches merge, one takes on the unio
n of the data | 27 * merged using combineIfPossible. When two batches merge, one takes on the unio
n of the data |
28 * and the other is left empty. The merged batch becomes responsible for drawing
the data from both | 28 * and the other is left empty. The merged batch becomes responsible for drawing
the data from both |
29 * the original batches. | 29 * the original batches. |
30 * | 30 * |
31 * If there are any possible optimizations which might require knowing more abou
t the full state of | 31 * If there are any possible optimizations which might require knowing more abou
t the full state of |
32 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag
e, then this | 32 * the draw, ie whether or not the GrBatch is allowed to tweak alpha for coverag
e, then this |
33 * information will be communicated to the GrBatch prior to geometry generation. | 33 * information will be communicated to the GrBatch prior to geometry generation. |
| 34 * |
| 35 * The bounds of the batch must contain all the pixels that would be modified *i
rrespective* of the |
| 36 * clip. The bounds are used in determining which clip elements must be applied
and thus the bounds |
| 37 * cannot in turn depend upon the clip. |
34 */ | 38 */ |
35 #define GR_BATCH_SPEW 0 | 39 #define GR_BATCH_SPEW 0 |
36 #if GR_BATCH_SPEW | 40 #if GR_BATCH_SPEW |
37 #define GrBATCH_INFO(...) SkDebugf(__VA_ARGS__) | 41 #define GrBATCH_INFO(...) SkDebugf(__VA_ARGS__) |
38 #define GrBATCH_SPEW(code) code | 42 #define GrBATCH_SPEW(code) code |
39 #else | 43 #else |
40 #define GrBATCH_SPEW(code) | 44 #define GrBATCH_SPEW(code) |
41 #define GrBATCH_INFO(...) | 45 #define GrBATCH_INFO(...) |
42 #endif | 46 #endif |
43 | 47 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 #if GR_BATCH_SPEW | 152 #if GR_BATCH_SPEW |
149 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } | 153 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } |
150 const uint32_t fUniqueID; | 154 const uint32_t fUniqueID; |
151 static int32_t gCurrBatchUniqueID; | 155 static int32_t gCurrBatchUniqueID; |
152 #endif | 156 #endif |
153 static int32_t gCurrBatchClassID; | 157 static int32_t gCurrBatchClassID; |
154 typedef GrNonAtomicRef INHERITED; | 158 typedef GrNonAtomicRef INHERITED; |
155 }; | 159 }; |
156 | 160 |
157 #endif | 161 #endif |
OLD | NEW |