8#ifndef GrVertexChunkArray_DEFINED
9#define GrVertexChunkArray_DEFINED
44 size_t stride,
int minVerticesPerChunk)
48 , fMinVerticesPerChunk(minVerticesPerChunk) {
54 size_t stride()
const {
return fStride; }
60 if (fCurrChunkVertexCount +
count > fCurrChunkVertexCapacity && !this->allocChunk(
count)) {
64 SkASSERT(fCurrChunkVertexCount +
count <= fCurrChunkVertexCapacity);
65 fCurrChunkVertexCount +=
count;
67 return std::exchange(fCurrChunkVertexWriter,
75 SkASSERT(fLastAppendAmount <= fCurrChunkVertexCount);
77 fCurrChunkVertexCount -=
count;
78 fCurrChunkVertexWriter = fCurrChunkVertexWriter.
makeOffset(fStride * -
count);
83 bool allocChunk(
int minCount);
88 int fMinVerticesPerChunk;
91 int fCurrChunkVertexCount = 0;
92 int fCurrChunkVertexCapacity = 0;
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void popVertices(int count)
GrVertexChunkBuilder(GrMeshDrawTarget *target, GrVertexChunkArray *chunks, size_t stride, int minVerticesPerChunk)
SK_ALWAYS_INLINE skgpu::VertexWriter appendVertices(int count)
sk_sp< const GrBuffer > fBuffer
std::true_type sk_is_trivially_relocatable
VertexWriter makeOffset(size_t offsetInBytes) const