Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
skgpu::graphite::DynamicInstancesPatchAllocator< FixedCountVariant > Class Template Reference

#include <DynamicInstancesPatchAllocator.h>

Public Member Functions

 DynamicInstancesPatchAllocator (size_t stride, DrawWriter &writer, BindBufferInfo fixedVertexBuffer, BindBufferInfo fixedIndexBuffer, unsigned int reserveCount)
 
VertexWriter append (const tess::LinearTolerances &tolerances)
 

Detailed Description

template<typename FixedCountVariant>
class skgpu::graphite::DynamicInstancesPatchAllocator< FixedCountVariant >

Definition at line 23 of file DynamicInstancesPatchAllocator.h.

Constructor & Destructor Documentation

◆ DynamicInstancesPatchAllocator()

template<typename FixedCountVariant >
skgpu::graphite::DynamicInstancesPatchAllocator< FixedCountVariant >::DynamicInstancesPatchAllocator ( size_t  stride,
DrawWriter writer,
BindBufferInfo  fixedVertexBuffer,
BindBufferInfo  fixedIndexBuffer,
unsigned int  reserveCount 
)
inline

Definition at line 29 of file DynamicInstancesPatchAllocator.h.

34 : fInstances(writer, fixedVertexBuffer, fixedIndexBuffer) {
35 SkASSERT(stride == writer.instanceStride());
36 // TODO: Is it worth re-reserving large chunks after this preallocation is used up? Or will
37 // appending 1 at a time be fine since it's coming from a large vertex buffer alloc anyway?
38 fInstances.reserve(reserveCount);
39 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

Member Function Documentation

◆ append()

template<typename FixedCountVariant >
VertexWriter skgpu::graphite::DynamicInstancesPatchAllocator< FixedCountVariant >::append ( const tess::LinearTolerances tolerances)
inline

Definition at line 41 of file DynamicInstancesPatchAllocator.h.

41 {
42 return fInstances.append(tolerances, 1);
43 }
VertexWriter append(const V &vertexCount, unsigned int instanceCount)
Definition: DrawWriter.h:365

The documentation for this class was generated from the following file: