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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void prepare(GrBatchFlushState* state) { this->onPrepare(state); } | 111 void prepare(GrBatchFlushState* state) { this->onPrepare(state); } |
112 | 112 |
113 /** Issues the batches commands to GrGpu. */ | 113 /** Issues the batches commands to GrGpu. */ |
114 void draw(GrBatchFlushState* state) { this->onDraw(state); } | 114 void draw(GrBatchFlushState* state) { this->onDraw(state); } |
115 | 115 |
116 /** Used to block batching across render target changes. Remove this once we
store | 116 /** Used to block batching across render target changes. Remove this once we
store |
117 GrBatches for different RTs in different targets. */ | 117 GrBatches for different RTs in different targets. */ |
118 virtual uint32_t renderTargetUniqueID() const = 0; | 118 virtual uint32_t renderTargetUniqueID() const = 0; |
119 | 119 |
120 /** Used for spewing information about batches when debugging. */ | 120 /** Used for spewing information about batches when debugging. */ |
121 virtual SkString dumpInfo() const = 0; | 121 virtual SkString dumpInfo() const { |
| 122 SkString string; |
| 123 string.appendf("BatchBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", |
| 124 fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBot
tom); |
| 125 return string; |
| 126 } |
122 | 127 |
123 /** Can remove this when multi-draw-buffer lands */ | 128 /** Can remove this when multi-draw-buffer lands */ |
124 virtual GrRenderTarget* renderTarget() const = 0; | 129 virtual GrRenderTarget* renderTarget() const = 0; |
125 | 130 |
126 protected: | 131 protected: |
127 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL
argest on the bounds | 132 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL
argest on the bounds |
128 // rect because we outset it for dst copy textures | 133 // rect because we outset it for dst copy textures |
129 void setBounds(const SkRect& newBounds) { fBounds = newBounds; } | 134 void setBounds(const SkRect& newBounds) { fBounds = newBounds; } |
130 | 135 |
131 void joinBounds(const SkRect& otherBounds) { | 136 void joinBounds(const SkRect& otherBounds) { |
(...skipping 27 matching lines...) Expand all Loading... |
159 | 164 |
160 SkDEBUGCODE(bool fUsed;) | 165 SkDEBUGCODE(bool fUsed;) |
161 const uint32_t fClassID; | 166 const uint32_t fClassID; |
162 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } | 167 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } |
163 mutable uint32_t fUniqueID; | 168 mutable uint32_t fUniqueID; |
164 static int32_t gCurrBatchUniqueID; | 169 static int32_t gCurrBatchUniqueID; |
165 static int32_t gCurrBatchClassID; | 170 static int32_t gCurrBatchClassID; |
166 }; | 171 }; |
167 | 172 |
168 #endif | 173 #endif |
OLD | NEW |