Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
skgpu::IndexWriter Struct Reference

#include <BufferWriter.h>

Inheritance diagram for skgpu::IndexWriter:
skgpu::BufferWriter

Public Member Functions

 IndexWriter ()=default
 
 IndexWriter (void *ptr, size_t size)
 
 IndexWriter (void *ptr, Mark end)
 
 IndexWriter (const IndexWriter &)=delete
 
 IndexWriter (IndexWriter &&that)
 
IndexWriteroperator= (const IndexWriter &)=delete
 
IndexWriteroperator= (IndexWriter &&that)
 
IndexWriter makeOffset (int numIndices) const
 
void writeArray (const uint16_t *array, int count)
 
- Public Member Functions inherited from skgpu::BufferWriter
 operator bool () const
 
Mark mark (size_t offset=0) const
 

Friends

IndexWriteroperator<< (IndexWriter &w, uint16_t val)
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::BufferWriter
 BufferWriter ()=default
 
 BufferWriter (void *ptr, size_t size)
 
 BufferWriter (void *ptr, Mark end={})
 
BufferWriteroperator= (const BufferWriter &)=delete
 
BufferWriteroperator= (BufferWriter &&that)
 
template<typename W >
W makeOffset (size_t offsetInBytes) const
 
void validate (size_t bytesToWrite) const
 
- Protected Attributes inherited from skgpu::BufferWriter
void * fPtr = nullptr
 

Detailed Description

Definition at line 380 of file BufferWriter.h.

Constructor & Destructor Documentation

◆ IndexWriter() [1/5]

skgpu::IndexWriter::IndexWriter ( )
default

◆ IndexWriter() [2/5]

skgpu::IndexWriter::IndexWriter ( void *  ptr,
size_t  size 
)
inline

Definition at line 383 of file BufferWriter.h.

383: BufferWriter(ptr, size) {}
BufferWriter()=default

◆ IndexWriter() [3/5]

skgpu::IndexWriter::IndexWriter ( void *  ptr,
Mark  end 
)
inline

Definition at line 384 of file BufferWriter.h.

384: BufferWriter(ptr, end) {}
glong glong end

◆ IndexWriter() [4/5]

skgpu::IndexWriter::IndexWriter ( const IndexWriter )
delete

◆ IndexWriter() [5/5]

skgpu::IndexWriter::IndexWriter ( IndexWriter &&  that)
inline

Definition at line 387 of file BufferWriter.h.

387{ *this = std::move(that); }

Member Function Documentation

◆ makeOffset()

IndexWriter skgpu::IndexWriter::makeOffset ( int  numIndices) const
inline

Definition at line 395 of file BufferWriter.h.

395 {
396 return this->BufferWriter::makeOffset<IndexWriter>(numIndices * sizeof(uint16_t));
397 }

◆ operator=() [1/2]

IndexWriter & skgpu::IndexWriter::operator= ( const IndexWriter )
delete

◆ operator=() [2/2]

IndexWriter & skgpu::IndexWriter::operator= ( IndexWriter &&  that)
inline

Definition at line 390 of file BufferWriter.h.

390 {
391 BufferWriter::operator=(std::move(that));
392 return *this;
393 }
BufferWriter & operator=(const BufferWriter &)=delete

◆ writeArray()

void skgpu::IndexWriter::writeArray ( const uint16_t *  array,
int  count 
)
inline

Definition at line 399 of file BufferWriter.h.

399 {
400 size_t arraySize = count * sizeof(uint16_t);
401 this->validate(arraySize);
402 memcpy(fPtr, array, arraySize);
403 fPtr = SkTAddOffset<void>(fPtr, arraySize);
404
405 }
int count
void validate(size_t bytesToWrite) const

Friends And Related Symbol Documentation

◆ operator<<

IndexWriter & operator<< ( IndexWriter w,
uint16_t  val 
)
friend

Definition at line 410 of file BufferWriter.h.

410 {
411 w.validate(sizeof(uint16_t));
412 memcpy(w.fPtr, &val, sizeof(uint16_t));
413 w = w.makeOffset(1);
414 return w;
415}
SkScalar w

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