joshualitt | 4d8da81 | 2015-01-28 12:53:54 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrBatchTarget.h" |
| 9 | |
joshualitt | 4d8da81 | 2015-01-28 12:53:54 -0800 | [diff] [blame] | 10 | #include "GrPipeline.h" |
| 11 | |
| 12 | /* |
| 13 | void GrBatchTarget::flush() { |
| 14 | FlushBuffer::Iter iter(fFlushBuffer); |
| 15 | fVertexPool->unmap(); |
| 16 | fIndexPool->unmap(); |
| 17 | |
| 18 | while (iter.next()) { |
| 19 | GrProgramDesc desc; |
| 20 | BufferedFlush* bf = iter.get(); |
| 21 | const GrPipeline* pipeline = bf->fPipeline; |
| 22 | const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 23 | fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker); |
joshualitt | 4d8da81 | 2015-01-28 12:53:54 -0800 | [diff] [blame] | 24 | |
| 25 | GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
| 26 | for (int i = 0; i < bf->fDraws.count(); i++) { |
| 27 | fGpu->draw(args, bf->fDraws[i]); |
| 28 | } |
| 29 | } |
| 30 | fFlushBuffer.reset(); |
| 31 | }*/ |
joshualitt | 7bc18b7 | 2015-02-03 16:41:41 -0800 | [diff] [blame] | 32 | /* |
| 33 | void GrBatchTarget::flushNext(int n) { |
| 34 | for (; n > 0; n--) { |
| 35 | SkDEBUGCODE(bool verify =) fIter.next(); |
| 36 | SkASSERT(verify); |
| 37 | GrProgramDesc desc; |
| 38 | BufferedFlush* bf = fIter.get(); |
| 39 | const GrPipeline* pipeline = bf->fPipeline; |
| 40 | const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 41 | fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker); |
joshualitt | 4d8da81 | 2015-01-28 12:53:54 -0800 | [diff] [blame] | 42 | |
joshualitt | 7bc18b7 | 2015-02-03 16:41:41 -0800 | [diff] [blame] | 43 | GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
| 44 | for (int i = 0; i < bf->fDraws.count(); i++) { |
| 45 | fGpu->draw(args, bf->fDraws[i]); |
| 46 | } |
joshualitt | 4d8da81 | 2015-01-28 12:53:54 -0800 | [diff] [blame] | 47 | } |
joshualitt | 7bc18b7 | 2015-02-03 16:41:41 -0800 | [diff] [blame] | 48 | }*/ |