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

Unified Diff: src/gpu/GrBatchTarget.h

Issue 862823004: Revert of GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: 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
« no previous file with comments | « src/gpu/GrBatch.cpp ('k') | src/gpu/GrBatchTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchTarget.h
diff --git a/src/gpu/GrBatchTarget.h b/src/gpu/GrBatchTarget.h
deleted file mode 100644
index 82dad45c22dc18e8588e4b6846968770b99cca7e..0000000000000000000000000000000000000000
--- a/src/gpu/GrBatchTarget.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrBatchBuffer_DEFINED
-#define GrBatchBuffer_DEFINED
-
-#include "GrPendingProgramElement.h"
-#include "GrGpu.h"
-#include "GrTRecorder.h"
-
-/*
- * GrBatch instances use this object to allocate space for their geometry and to issue the draws
- * that render their batch.
- */
-
-class GrBatchTarget : public SkNoncopyable {
-public:
- GrBatchTarget(GrGpu* gpu,
- GrVertexBufferAllocPool* vpool,
- GrIndexBufferAllocPool* ipool)
- : fGpu(gpu)
- , fVertexPool(vpool)
- , fIndexPool(ipool)
- , fFlushBuffer(kFlushBufferInitialSizeInBytes) {}
-
- typedef GrDrawTarget::DrawInfo DrawInfo;
- void initDraw(const GrPrimitiveProcessor* primProc, const GrPipeline* pipeline) {
- GrNEW_APPEND_TO_RECORDER(fFlushBuffer, BufferedFlush, (primProc, pipeline));
- }
-
- void draw(const GrDrawTarget::DrawInfo& draw) {
- fFlushBuffer.back().fDraws.push_back(draw);
- }
- void flush();
-
- // TODO This goes away when everything uses batch
- GrBatchTracker* currentBatchTracker() {
- SkASSERT(!fFlushBuffer.empty());
- return &fFlushBuffer.back().fBatchTracker;
- }
-
- GrVertexBufferAllocPool* vertexPool() { return fVertexPool; }
- GrIndexBufferAllocPool* indexPool() { return fIndexPool; }
-
-private:
- GrGpu* fGpu;
- GrVertexBufferAllocPool* fVertexPool;
- GrIndexBufferAllocPool* fIndexPool;
-
- typedef void* TBufferAlign; // This wouldn't be enough align if a command used long double.
-
- struct BufferedFlush {
- BufferedFlush(const GrPrimitiveProcessor* primProc, const GrPipeline* pipeline)
- : fPrimitiveProcessor(primProc)
- , fPipeline(pipeline)
- , fDraws(kDrawRecorderInitialSizeInBytes) {}
- typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitiveProcessor;
- ProgramPrimitiveProcessor fPrimitiveProcessor;
- const GrPipeline* fPipeline;
- GrBatchTracker fBatchTracker;
- SkSTArray<4, DrawInfo, true> fDraws;
- };
-
- enum {
- kFlushBufferInitialSizeInBytes = 8 * sizeof(BufferedFlush),
- kDrawRecorderInitialSizeInBytes = 8 * sizeof(DrawInfo),
- };
-
- typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer;
-
- FlushBuffer fFlushBuffer;
-};
-
-#endif
« no previous file with comments | « src/gpu/GrBatch.cpp ('k') | src/gpu/GrBatchTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698