Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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.

326 : GrBufferAllocPool(gpu, GrGpuBufferType::kDrawIndirect, std::move(cpuBufferCache)) {}
GrBufferAllocPool(GrGpu *gpu, GrGpuBufferType bufferType, sk_sp< CpuBufferCache > cpuBufferCache)

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)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
SeparatedVector2 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}
static void VALIDATE(bool=false)

◆ 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: