diff options
Diffstat (limited to 'src/gpu/GrBatchFlushState.cpp')
-rw-r--r-- | src/gpu/GrBatchFlushState.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gpu/GrBatchFlushState.cpp b/src/gpu/GrBatchFlushState.cpp new file mode 100644 index 0000000000..f12066609e --- /dev/null +++ b/src/gpu/GrBatchFlushState.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 "GrBatchFlushState.h" + +#include "GrBatchAtlas.h" +#include "GrPipeline.h" + +GrBatchFlushState::GrBatchFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider, + GrBatchToken lastFlushedToken) + : fGpu(gpu) + , fUploader(gpu) + , fResourceProvider(resourceProvider) + , fVertexPool(gpu) + , fIndexPool(gpu) + , fCurrentToken(lastFlushedToken) + , fLastFlushedToken(lastFlushedToken) {} + +void* GrBatchFlushState::makeVertexSpace(size_t vertexSize, int vertexCount, + const GrVertexBuffer** buffer, int* startVertex) { + return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex); +} + +uint16_t* GrBatchFlushState::makeIndexSpace(int indexCount, + const GrIndexBuffer** buffer, int* startIndex) { + return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer, startIndex)); +} |