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

Unified Diff: src/gpu/GrBatchBuffer.cpp

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: a bit more tweaking 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..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();
+}

Powered by Google App Engine
This is Rietveld 408576698