Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: src/gpu/GrBatchBuffer.cpp

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: whoops missed the comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrBatchBuffer.cpp
diff --git a/src/gpu/GrBatchBuffer.cpp b/src/gpu/GrBatchBuffer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d63d0ff3630d4692e6edfc72aa844c4e8bbedf7f
--- /dev/null
+++ b/src/gpu/GrBatchBuffer.cpp
@@ -0,0 +1,31 @@
+/*
+ * 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 GrBatchTarget::flush() {
+ FlushBuffer::Iter iter(fFlushBuffer);
+ fVertexPool->unmap();
+ fIndexPool->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();
+}
« src/gpu/GrBatch.h ('K') | « src/gpu/GrBatchBuffer.h ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698