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
SkWBuffer Class Reference

#include <SkBuffer.h>

Inheritance diagram for SkWBuffer:
SkNoncopyable

Public Member Functions

 SkWBuffer ()
 
 SkWBuffer (void *data)
 
 SkWBuffer (void *data, size_t size)
 
void reset (void *data)
 
void reset (void *data, size_t size)
 
size_t pos () const
 
void * skip (size_t size)
 
void write (const void *buffer, size_t size)
 
size_t padToAlign4 ()
 
void writePtr (const void *x)
 
void writeScalar (SkScalar x)
 
void write32 (int32_t x)
 
void write16 (int16_t x)
 
void write8 (int8_t x)
 
void writeBool (bool x)
 

Detailed Description

Light weight class for writing data to a memory block. The WBuffer is given the buffer to write into, with either a specified size or no size, in which case no range checking is performed. An empty WBuffer is legal, in which case no data is ever written, but the relative pos() is updated.

Definition at line 89 of file SkBuffer.h.

Constructor & Destructor Documentation

◆ SkWBuffer() [1/3]

SkWBuffer::SkWBuffer ( )
inline

Definition at line 91 of file SkBuffer.h.

91: fData(nullptr), fPos(nullptr), fStop(nullptr) {}

◆ SkWBuffer() [2/3]

SkWBuffer::SkWBuffer ( void *  data)
inline

Definition at line 92 of file SkBuffer.h.

92{ reset(data); }
void reset(void *data)
Definition: SkBuffer.h:95
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ SkWBuffer() [3/3]

SkWBuffer::SkWBuffer ( void *  data,
size_t  size 
)
inline

Definition at line 93 of file SkBuffer.h.

93{ reset(data, size); }
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

Member Function Documentation

◆ padToAlign4()

size_t SkWBuffer::padToAlign4 ( )

Definition at line 63 of file SkBuffer.cpp.

63 {
64 size_t pos = this->pos();
65 size_t n = SkAlign4(pos) - pos;
66
67 if (n && fData)
68 {
69 char* p = fPos;
70 char* stop = p + n;
71 do {
72 *p++ = 0;
73 } while (p < stop);
74 }
75 fPos += n;
76 return n;
77}
static constexpr T SkAlign4(T x)
Definition: SkAlign.h:16
size_t pos() const
Definition: SkBuffer.h:108

◆ pos()

size_t SkWBuffer::pos ( ) const
inline

Definition at line 108 of file SkBuffer.h.

108{ return fPos - fData; }

◆ reset() [1/2]

void SkWBuffer::reset ( void *  data)
inline

Definition at line 95 of file SkBuffer.h.

95 {
96 fData = (char*)data;
97 fPos = (char*)data;
98 fStop = nullptr; // no bounds checking
99 }

◆ reset() [2/2]

void SkWBuffer::reset ( void *  data,
size_t  size 
)
inline

Definition at line 101 of file SkBuffer.h.

101 {
102 SkASSERT(data != nullptr || size == 0);
103 fData = (char*)data;
104 fPos = (char*)data;
105 fStop = (char*)data + size;
106 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ skip()

void * SkWBuffer::skip ( size_t  size)

Definition at line 49 of file SkBuffer.cpp.

49 {
50 void* result = fPos;
51 writeNoSizeCheck(nullptr, size);
52 return fData == nullptr ? nullptr : result;
53}
GAsyncResult * result

◆ write()

void SkWBuffer::write ( const void *  buffer,
size_t  size 
)
inline

Definition at line 111 of file SkBuffer.h.

111 {
112 if (size) {
113 this->writeNoSizeCheck(buffer, size);
114 }
115 }
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

◆ write16()

void SkWBuffer::write16 ( int16_t  x)
inline

Definition at line 122 of file SkBuffer.h.

122{ this->writeNoSizeCheck(&x, 2); }
double x

◆ write32()

void SkWBuffer::write32 ( int32_t  x)
inline

Definition at line 121 of file SkBuffer.h.

121{ this->writeNoSizeCheck(&x, 4); }

◆ write8()

void SkWBuffer::write8 ( int8_t  x)
inline

Definition at line 123 of file SkBuffer.h.

123{ this->writeNoSizeCheck(&x, 1); }

◆ writeBool()

void SkWBuffer::writeBool ( bool  x)
inline

Definition at line 124 of file SkBuffer.h.

124{ this->write8(x); }
void write8(int8_t x)
Definition: SkBuffer.h:123

◆ writePtr()

void SkWBuffer::writePtr ( const void *  x)
inline

Definition at line 119 of file SkBuffer.h.

119{ this->writeNoSizeCheck(&x, sizeof(x)); }

◆ writeScalar()

void SkWBuffer::writeScalar ( SkScalar  x)
inline

Definition at line 120 of file SkBuffer.h.

120{ this->writeNoSizeCheck(&x, 4); }

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