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 #include "GrBatchTarget.h" | 8 #include "GrBatchTarget.h" |
9 | 9 |
10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 bf->fBatchTracker); | 25 bf->fBatchTracker); |
26 | 26 |
27 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); | 27 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
28 for (int i = 0; i < bf->fDraws.count(); i++) { | 28 for (int i = 0; i < bf->fDraws.count(); i++) { |
29 fGpu->draw(args, bf->fDraws[i]); | 29 fGpu->draw(args, bf->fDraws[i]); |
30 } | 30 } |
31 } | 31 } |
32 fFlushBuffer.reset(); | 32 fFlushBuffer.reset(); |
33 }*/ | 33 }*/ |
34 | 34 |
35 void GrBatchTarget::flushNext() { | 35 void GrBatchTarget::flushNext(int n) { |
36 fIter.next(); | 36 for (; n > 0; n--) { |
37 GrProgramDesc desc; | 37 SkDEBUGCODE(bool verify =) fIter.next(); |
38 BufferedFlush* bf = fIter.get(); | 38 SkASSERT(verify); |
39 const GrPipeline* pipeline = bf->fPipeline; | 39 GrProgramDesc desc; |
40 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); | 40 BufferedFlush* bf = fIter.get(); |
41 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descInfo(), | 41 const GrPipeline* pipeline = bf->fPipeline; |
42 bf->fBatchTracker); | 42 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); |
| 43 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descInfo()
, |
| 44 bf->fBatchTracker); |
43 | 45 |
44 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); | 46 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
45 for (int i = 0; i < bf->fDraws.count(); i++) { | 47 for (int i = 0; i < bf->fDraws.count(); i++) { |
46 fGpu->draw(args, bf->fDraws[i]); | 48 fGpu->draw(args, bf->fDraws[i]); |
| 49 } |
47 } | 50 } |
48 } | 51 } |
OLD | NEW |