Index: src/gpu/GrBatchBuffer.cpp |
diff --git a/src/gpu/GrBatchBuffer.cpp b/src/gpu/GrBatchBuffer.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ef58536da706c09b6918ba8d910522fc8bf3ecb8 |
--- /dev/null |
+++ b/src/gpu/GrBatchBuffer.cpp |
@@ -0,0 +1,30 @@ |
+/* |
+ * 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 "GrBatchBuffer.h" |
+#include "GrBufferAllocPool.h" |
+#include "GrOptDrawState.h" |
+ |
+void GrBatchBuffer::flush() { |
+ FlushBuffer::Iter iter(fFlushBuffer); |
+ fVertexPool->unmap(); |
bsalomon
2015/01/21 21:39:29
index pool unmap?
|
+ |
+ while (iter.next()) { |
+ GrProgramDesc desc; |
+ BufferedFlush* bf = iter.get(); |
+ const GrOptDrawState* optState = bf->fOptState; |
+ const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get(); |
+ fGpu->buildProgramDesc(&desc, *primProc, *optState, optState->descInfo(), |
+ bf->fBatchTracker); |
+ |
+ GrGpu::DrawArgs args(primProc, optState, &desc, &bf->fBatchTracker); |
+ for (int i = 0; i < bf->fDraws.count(); i++) { |
+ fGpu->draw(args, bf->fDraws[i]); |
+ } |
+ } |
+ fFlushBuffer.reset(); |
+} |