OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #include "GrDrawTarget.h" | 8 #include "GrDrawTarget.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 fRecordedBatches[i].fBatch->prepare(flushState); | 209 fRecordedBatches[i].fBatch->prepare(flushState); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 if (fInstancedRendering) { | 213 if (fInstancedRendering) { |
214 fInstancedRendering->beginFlush(flushState->resourceProvider()); | 214 fInstancedRendering->beginFlush(flushState->resourceProvider()); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) { | 218 void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) { |
| 219 if (0 == fRecordedBatches.count()) { |
| 220 return; |
| 221 } |
219 // Draw all the generated geometry. | 222 // Draw all the generated geometry. |
220 SkRandom random; | 223 SkRandom random; |
221 GrRenderTarget* currentRT = nullptr; | 224 GrRenderTarget* currentRT = nullptr; |
222 SkAutoTDelete<GrGpuCommandBuffer> commandBuffer; | 225 SkAutoTDelete<GrGpuCommandBuffer> commandBuffer; |
223 SkRect bounds = SkRect::MakeEmpty(); | 226 SkRect bounds = SkRect::MakeEmpty(); |
224 for (int i = 0; i < fRecordedBatches.count(); ++i) { | 227 for (int i = 0; i < fRecordedBatches.count(); ++i) { |
225 if (!fRecordedBatches[i].fBatch) { | 228 if (!fRecordedBatches[i].fBatch) { |
226 continue; | 229 continue; |
227 } | 230 } |
228 if (fRecordedBatches[i].fBatch->renderTarget() != currentRT) { | 231 if (fRecordedBatches[i].fBatch->renderTarget() != currentRT) { |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 } | 596 } |
594 } | 597 } |
595 | 598 |
596 /////////////////////////////////////////////////////////////////////////////// | 599 /////////////////////////////////////////////////////////////////////////////// |
597 | 600 |
598 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 601 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
599 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 602 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
600 this->recordBatch(batch, batch->bounds()); | 603 this->recordBatch(batch, batch->bounds()); |
601 batch->unref(); | 604 batch->unref(); |
602 } | 605 } |
OLD | NEW |