OLD | NEW |
(Empty) | |
| 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 "GrBatchBuffer.h" |
| 9 #include "GrBufferAllocPool.h" |
| 10 #include "GrOptDrawState.h" |
| 11 |
| 12 void GrBatchTarget::flush() { |
| 13 FlushBuffer::Iter iter(fFlushBuffer); |
| 14 fVertexPool->unmap(); |
| 15 fIndexPool->unmap(); |
| 16 |
| 17 while (iter.next()) { |
| 18 GrProgramDesc desc; |
| 19 BufferedFlush* bf = iter.get(); |
| 20 const GrOptDrawState* optState = bf->fOptState; |
| 21 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); |
| 22 fGpu->buildProgramDesc(&desc, *primProc, *optState, optState->descInfo()
, |
| 23 bf->fBatchTracker); |
| 24 |
| 25 GrGpu::DrawArgs args(primProc, optState, &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 } |
OLD | NEW |