13 if (!fChunks->
empty()) {
14 fTarget->
putBackVertices(fCurrChunkVertexCapacity - fCurrChunkVertexCount, fStride);
15 fChunks->
back().
fCount = fCurrChunkVertexCount;
19bool GrVertexChunkBuilder::allocChunk(
int minCount) {
20 if (!fChunks->
empty()) {
22 fChunks->
back().
fCount = fCurrChunkVertexCount;
24 fCurrChunkVertexCount = 0;
26 int minAllocCount =
std::max(minCount, fMinVerticesPerChunk);
30 &fCurrChunkVertexCapacity);
31 if (!fCurrChunkVertexWriter || !chunk->
fBuffer || fCurrChunkVertexCapacity < minCount) {
32 SkDebugf(
"WARNING: Failed to allocate vertex buffer for GrVertexChunk.\n");
34 SkASSERT(fCurrChunkVertexCount == 0);
35 fCurrChunkVertexCapacity = 0;
38 fMinVerticesPerChunk *= 2;
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
skgpu::VertexWriter makeVertexWriterAtLeast(size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount)
virtual void putBackVertices(int vertices, size_t vertexStride)=0
static float max(float r, float g, float b)
sk_sp< const GrBuffer > fBuffer