blob: 21658d2a01a19eb31ad7343c32649a29c86a8228 [file] [log] [blame]
joshualitt4d8da812015-01-28 12:53:54 -08001/*
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
joshualitt4d8da812015-01-28 12:53:54 -080010#include "GrPipeline.h"
11
12/*
13void 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();
bsalomon50785a32015-02-06 07:02:37 -080023 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
joshualitt4d8da812015-01-28 12:53:54 -080024
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}*/
joshualitt7bc18b72015-02-03 16:41:41 -080032/*
33void 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();
bsalomon50785a32015-02-06 07:02:37 -080041 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
joshualitt4d8da812015-01-28 12:53:54 -080042
joshualitt7bc18b72015-02-03 16:41:41 -080043 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 }
joshualitt4d8da812015-01-28 12:53:54 -080047 }
joshualitt7bc18b72015-02-03 16:41:41 -080048}*/