| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrBatchFlushState.h" | 8 #include "GrBatchFlushState.h" |
| 9 | 9 |
| 10 #include "GrBatchAtlas.h" | 10 #include "GrBatchAtlas.h" |
| 11 #include "GrPipeline.h" | 11 #include "GrPipeline.h" |
| 12 | 12 |
| 13 GrBatchFlushState::GrBatchFlushState(GrGpu* gpu, GrResourceProvider* resourcePro
vider, | 13 GrBatchFlushState::GrBatchFlushState(GrGpu* gpu, GrResourceProvider* resourcePro
vider) |
| 14 GrBatchToken lastFlushedToken) | |
| 15 : fGpu(gpu) | 14 : fGpu(gpu) |
| 16 , fUploader(gpu) | 15 , fUploader(gpu) |
| 17 , fResourceProvider(resourceProvider) | 16 , fResourceProvider(resourceProvider) |
| 18 , fVertexPool(gpu) | 17 , fVertexPool(gpu) |
| 19 , fIndexPool(gpu) | 18 , fIndexPool(gpu) |
| 20 , fCurrentToken(lastFlushedToken) | 19 , fCurrentToken(0) |
| 21 , fLastFlushedToken(lastFlushedToken) {} | 20 , fLastFlushedToken(0) {} |
| 22 | 21 |
| 23 void* GrBatchFlushState::makeVertexSpace(size_t vertexSize, int vertexCount, | 22 void* GrBatchFlushState::makeVertexSpace(size_t vertexSize, int vertexCount, |
| 24 const GrVertexBuffer** buffer, int* sta
rtVertex) { | 23 const GrVertexBuffer** buffer, int* sta
rtVertex) { |
| 25 return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex); | 24 return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex); |
| 26 } | 25 } |
| 27 | 26 |
| 28 uint16_t* GrBatchFlushState::makeIndexSpace(int indexCount, | 27 uint16_t* GrBatchFlushState::makeIndexSpace(int indexCount, |
| 29 const GrIndexBuffer** buffer, int* s
tartIndex) { | 28 const GrIndexBuffer** buffer, int* s
tartIndex) { |
| 30 return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer,
startIndex)); | 29 return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer,
startIndex)); |
| 31 } | 30 } |
| OLD | NEW |