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

Unified Diff: src/gpu/GrBatchTarget.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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
« no previous file with comments | « src/gpu/GrBatchTarget.h ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchTarget.cpp
diff --git a/src/gpu/GrBatchTarget.cpp b/src/gpu/GrBatchTarget.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..874158e647a4562dd16ea5845be6d1925de4080c
--- /dev/null
+++ b/src/gpu/GrBatchTarget.cpp
@@ -0,0 +1,68 @@
+/*
+ * 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"
+
+#if 0
+#include "GrBatchAtlas.h"
+#include "GrPipeline.h"
+
+GrBatchTarget::GrBatchTarget(GrFoo* foo, GrGpu* gpu, GrRenderTarget* dst)
+ : fGpu1(gpu)
+ , fFoo1(foo)
+ , fRT(dst)
+ , fVertexPool(gpu)
+ , fIndexPool(gpu)
+ , fFlushBuffer(kFlushBufferInitialSizeInBytes)
+ , fIter(fFlushBuffer)
+ , fNumberOfDraws(0)
+// , fCurrentToken1(0)
+ , fLastFlushedToken(0)
+ , fInlineUpdatesIndex(0) {
+}
+
+void GrBatchTarget::flushNext(int n) {
+ for (; n > 0; n--) {
+ fLastFlushedToken++;
+ SkDEBUGCODE(bool verify =) fIter.next();
+ SkASSERT(verify);
+
+ BufferedFlush* bf = fIter.get();
+
+ // Flush all texture uploads
+ int uploadCount = fInlineUploads.count();
+ while (fInlineUpdatesIndex < uploadCount &&
+ fInlineUploads[fInlineUpdatesIndex]->lastUploadToken() <= fLastFlushedToken) {
+ fInlineUploads[fInlineUpdatesIndex++]->upload(TextureUploader(fGpu1));
+ }
+
+ GrProgramDesc desc;
+ const GrPipeline* pipeline = bf->fPipeline;
+ const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
+ fGpu1->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
+
+ GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
+
+ int drawCount = bf->fVertexDraws.count();
+ const SkSTArray<1, GrVertices, true>& vertexDraws = bf->fVertexDraws;
+ for (int i = 0; i < drawCount; i++) {
+ fGpu1->draw(args, vertexDraws[i]);
+ }
+ }
+}
+
+void* GrBatchTarget::makeVertSpace(size_t vertexSize, int vertexCount,
+ const GrVertexBuffer** buffer, int* startVertex) {
+ return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex);
+}
+
+uint16_t* GrBatchTarget::makeIndexSpace(int indexCount,
+ const GrIndexBuffer** buffer, int* startIndex) {
+ return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer, startIndex));
+}
+
+#endif
« no previous file with comments | « src/gpu/GrBatchTarget.h ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698