GrBatchPrototype
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/d15e4e45374275c045572b304c229237c4a82be4
Committed: https://skia.googlesource.com/skia/+/d5a7db4a867c7e6ccf8451a053d987b470099198
Review URL: https://codereview.chromium.org/845103005
diff --git a/src/gpu/GrBatchTarget.cpp b/src/gpu/GrBatchTarget.cpp
new file mode 100644
index 0000000..6a31353
--- /dev/null
+++ b/src/gpu/GrBatchTarget.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrBatchTarget.h"
+
+#include "GrBufferAllocPool.h"
+#include "GrPipeline.h"
+
+/*
+void GrBatchTarget::flush() {
+ FlushBuffer::Iter iter(fFlushBuffer);
+ fVertexPool->unmap();
+ fIndexPool->unmap();
+
+ while (iter.next()) {
+ GrProgramDesc desc;
+ BufferedFlush* bf = iter.get();
+ const GrPipeline* pipeline = bf->fPipeline;
+ const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
+ fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descInfo(),
+ bf->fBatchTracker);
+
+ GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
+ for (int i = 0; i < bf->fDraws.count(); i++) {
+ fGpu->draw(args, bf->fDraws[i]);
+ }
+ }
+ fFlushBuffer.reset();
+}*/
+
+void GrBatchTarget::flushNext() {
+ fIter.next();
+ GrProgramDesc desc;
+ BufferedFlush* bf = fIter.get();
+ const GrPipeline* pipeline = bf->fPipeline;
+ const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
+ fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descInfo(),
+ bf->fBatchTracker);
+
+ GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
+ for (int i = 0; i < bf->fDraws.count(); i++) {
+ fGpu->draw(args, bf->fDraws[i]);
+ }
+}