blob: 7a2d14e923fb610e8d37ccfe831b5dc02a317a3c [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
10#include "GrBufferAllocPool.h"
11#include "GrPipeline.h"
12
13/*
14void GrBatchTarget::flush() {
15 FlushBuffer::Iter iter(fFlushBuffer);
16 fVertexPool->unmap();
17 fIndexPool->unmap();
18
19 while (iter.next()) {
20 GrProgramDesc desc;
21 BufferedFlush* bf = iter.get();
22 const GrPipeline* pipeline = bf->fPipeline;
23 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
egdaniel74a11752015-02-03 15:02:43 -080024 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
joshualitt4d8da812015-01-28 12:53:54 -080025
26 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
27 for (int i = 0; i < bf->fDraws.count(); i++) {
28 fGpu->draw(args, bf->fDraws[i]);
29 }
30 }
31 fFlushBuffer.reset();
32}*/
joshualitt7bc18b72015-02-03 16:41:41 -080033/*
34void GrBatchTarget::flushNext(int n) {
35 for (; n > 0; n--) {
36 SkDEBUGCODE(bool verify =) fIter.next();
37 SkASSERT(verify);
38 GrProgramDesc desc;
39 BufferedFlush* bf = fIter.get();
40 const GrPipeline* pipeline = bf->fPipeline;
41 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
42 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
joshualitt4d8da812015-01-28 12:53:54 -080043
joshualitt7bc18b72015-02-03 16:41:41 -080044 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
45 for (int i = 0; i < bf->fDraws.count(); i++) {
46 fGpu->draw(args, bf->fDraws[i]);
47 }
joshualitt4d8da812015-01-28 12:53:54 -080048 }
joshualitt7bc18b72015-02-03 16:41:41 -080049}*/