Line data Source code
1 : /*
2 : * Copyright 2015 Google Inc.
3 : *
4 : * Use of this source code is governed by a BSD-style license that can be
5 : * found in the LICENSE file.
6 : */
7 :
8 : #include "GrOpFlushState.h"
9 :
10 : #include "GrDrawOpAtlas.h"
11 : #include "GrPipeline.h"
12 :
13 0 : GrOpFlushState::GrOpFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider)
14 : : fGpu(gpu)
15 : , fResourceProvider(resourceProvider)
16 : , fCommandBuffer(nullptr)
17 : , fVertexPool(gpu)
18 : , fIndexPool(gpu)
19 : , fLastIssuedToken(GrDrawOpUploadToken::AlreadyFlushedToken())
20 : , fLastFlushedToken(0)
21 0 : , fOpArgs(nullptr) {}
22 :
23 0 : void* GrOpFlushState::makeVertexSpace(size_t vertexSize, int vertexCount,
24 : const GrBuffer** buffer, int* startVertex) {
25 0 : return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex);
26 : }
27 :
28 0 : uint16_t* GrOpFlushState::makeIndexSpace(int indexCount,
29 : const GrBuffer** buffer, int* startIndex) {
30 0 : return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer, startIndex));
31 : }
|