Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
skgpu::BufferWriter Struct Reference

#include <BufferWriter.h>

Inheritance diagram for skgpu::BufferWriter:
skgpu::IndexWriter skgpu::TextureUploadWriter skgpu::UniformWriter skgpu::VertexWriter

Classes

struct  Mark
 

Public Member Functions

 operator bool () const
 
Mark mark (size_t offset=0) const
 

Protected Member Functions

 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

void * fPtr = nullptr
 

Detailed Description

Definition at line 31 of file BufferWriter.h.

Constructor & Destructor Documentation

◆ BufferWriter() [1/3]

skgpu::BufferWriter::BufferWriter ( )
protecteddefault

◆ BufferWriter() [2/3]

skgpu::BufferWriter::BufferWriter ( void *  ptr,
size_t  size 
)
inlineprotected

Definition at line 65 of file BufferWriter.h.

65 : fPtr(ptr) {
66 SkDEBUGCODE(fEnd = Mark(ptr, ptr ? size : 0);)
67 }
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ BufferWriter() [3/3]

skgpu::BufferWriter::BufferWriter ( void *  ptr,
Mark  end = {} 
)
inlineprotected

Definition at line 68 of file BufferWriter.h.

68 {}) : fPtr(ptr) {
69 SkDEBUGCODE(fEnd = end;)
70 }

Member Function Documentation

◆ makeOffset()

template<typename W >
W skgpu::BufferWriter::makeOffset ( size_t  offsetInBytes) const
inlineprotected

Definition at line 94 of file BufferWriter.h.

94 {
95 this->validate(offsetInBytes);
96 void* p = SkTAddOffset<void>(fPtr, offsetInBytes);
97 Mark end{SkDEBUGCODE(fEnd)};
98 SkDEBUGCODE(fEnd = Mark(p);)
99 return W{p, end};
100 }
#define W
Definition: aaa.cpp:17
glong glong end
void validate(size_t bytesToWrite) const
Definition: BufferWriter.h:102

◆ mark()

Mark skgpu::BufferWriter::mark ( size_t  offset = 0) const
inline

Definition at line 58 of file BufferWriter.h.

58 {
59 this->validate(offset);
60 return Mark(fPtr, offset);
61 }
SeparatedVector2 offset

◆ operator bool()

skgpu::BufferWriter::operator bool ( ) const
inlineexplicit

Definition at line 56 of file BufferWriter.h.

56{ return fPtr != nullptr; }

◆ operator=() [1/2]

BufferWriter & skgpu::BufferWriter::operator= ( BufferWriter &&  that)
inlineprotected

Definition at line 73 of file BufferWriter.h.

73 {
74 fPtr = that.fPtr;
75 that.fPtr = nullptr;
76 SkDEBUGCODE(fEnd = that.fEnd;)
77 SkDEBUGCODE(that.fEnd = Mark();)
78 return *this;
79 }

◆ operator=() [2/2]

BufferWriter & skgpu::BufferWriter::operator= ( const BufferWriter )
protecteddelete

◆ validate()

void skgpu::BufferWriter::validate ( size_t  bytesToWrite) const
inlineprotected

Definition at line 102 of file BufferWriter.h.

102 {
103 // If the buffer writer had an end marked, make sure we're not crossing it.
104 // Ideally, all creators of BufferWriters mark the end, but a lot of legacy code is not set
105 // up to easily do this.
106 SkASSERT(fPtr || bytesToWrite == 0);
107 SkASSERT(!fEnd || Mark(fPtr, bytesToWrite) <= fEnd);
108 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

Member Data Documentation

◆ fPtr

void* skgpu::BufferWriter::fPtr = nullptr
protected

Definition at line 111 of file BufferWriter.h.


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