Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GrDrawIndirectBufferAllocPool Class Reference

#include <GrBufferAllocPool.h>

Inheritance diagram for GrDrawIndirectBufferAllocPool:
GrBufferAllocPool

Public Member Functions

 GrDrawIndirectBufferAllocPool (GrGpu *gpu, sk_sp< CpuBufferCache > cpuBufferCache)
 
GrDrawIndirectWriter makeSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset)
 
void putBack (int drawCount)
 
GrDrawIndexedIndirectWriter makeIndexedSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset)
 
void putBackIndexed (int drawCount)
 
void unmap ()
 
void reset ()
 

Detailed Description

Definition at line 323 of file GrBufferAllocPool.h.

Constructor & Destructor Documentation

◆ GrDrawIndirectBufferAllocPool()

GrDrawIndirectBufferAllocPool::GrDrawIndirectBufferAllocPool ( GrGpu gpu,
sk_sp< CpuBufferCache cpuBufferCache 
)
inline

Definition at line 325 of file GrBufferAllocPool.h.

Member Function Documentation

◆ makeIndexedSpace()

GrDrawIndexedIndirectWriter GrDrawIndirectBufferAllocPool::makeIndexedSpace ( int  drawCount,
sk_sp< const GrBuffer > *  buffer,
size_t *  offset 
)
inline

Definition at line 337 of file GrBufferAllocPool.h.

338 {
339 return this->GrBufferAllocPool::makeSpace(
340 drawCount * sizeof(GrDrawIndexedIndirectCommand), 4, buffer, offset);
341 }
void * makeSpace(size_t size, size_t alignment, sk_sp< const GrBuffer > *buffer, size_t *offset)
static const uint8_t buffer[]
Point offset

◆ makeSpace()

GrDrawIndirectWriter GrDrawIndirectBufferAllocPool::makeSpace ( int  drawCount,
sk_sp< const GrBuffer > *  buffer,
size_t *  offset 
)
inline

Definition at line 328 of file GrBufferAllocPool.h.

328 {
329 return this->GrBufferAllocPool::makeSpace(drawCount * sizeof(GrDrawIndirectCommand), 4,
330 buffer, offset);
331 }

◆ putBack()

void GrDrawIndirectBufferAllocPool::putBack ( int  drawCount)
inline

Definition at line 333 of file GrBufferAllocPool.h.

333 {
334 this->GrBufferAllocPool::putBack(drawCount * sizeof(GrDrawIndirectCommand));
335 }
void putBack(size_t bytes)

◆ putBackIndexed()

void GrDrawIndirectBufferAllocPool::putBackIndexed ( int  drawCount)
inline

Definition at line 343 of file GrBufferAllocPool.h.

343 {
345 }

◆ reset()

void GrBufferAllocPool::reset ( )

Invalidates all the data in the pool, unrefs non-preallocated buffers.

Definition at line 70 of file GrBufferAllocPool.cpp.

113 {
114 VALIDATE();
115 fBytesInUse = 0;
116 this->deleteBlocks();
117 this->resetCpuData(0);
118 VALIDATE();
119}
#define VALIDATE()

◆ unmap()

void GrBufferAllocPool::unmap ( )

Ensures all buffers are unmapped and have all data written to them. Call before drawing using buffers from the pool.

Definition at line 65 of file GrBufferAllocPool.cpp.

121 {
122 VALIDATE();
123
124 if (fBufferPtr) {
125 BufferBlock& block = fBlocks.back();
126 GrBuffer* buffer = block.fBuffer.get();
127 if (!buffer->isCpuBuffer()) {
128 if (static_cast<GrGpuBuffer*>(buffer)->isMapped()) {
129 UNMAP_BUFFER(block);
130 } else {
131 size_t flushSize = block.fBuffer->size() - block.fBytesFree;
132 this->flushCpuData(fBlocks.back(), flushSize);
133 }
134 }
135 fBufferPtr = nullptr;
136 }
137 VALIDATE();
138}
#define UNMAP_BUFFER(block)

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