Chromium Code Reviews| 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 GrBatchBuffer::flush() { | |
| 13 FlushBuffer::Iter iter(fFlushBuffer); | |
| 14 fVertexPool->unmap(); | |
|
bsalomon
2015/01/21 21:39:29
index pool unmap?
| |
| 15 | |
| 16 while (iter.next()) { | |
| 17 GrProgramDesc desc; | |
| 18 BufferedFlush* bf = iter.get(); | |
| 19 const GrOptDrawState* optState = bf->fOptState; | |
| 20 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); | |
| 21 fGpu->buildProgramDesc(&desc, *primProc, *optState, optState->descInfo() , | |
| 22 bf->fBatchTracker); | |
| 23 | |
| 24 GrGpu::DrawArgs args(primProc, optState, &desc, &bf->fBatchTracker); | |
| 25 for (int i = 0; i < bf->fDraws.count(); i++) { | |
| 26 fGpu->draw(args, bf->fDraws[i]); | |
| 27 } | |
| 28 } | |
| 29 fFlushBuffer.reset(); | |
| 30 } | |
| OLD | NEW |