#include <SkWriter32.h>
Definition at line 34 of file SkWriter32.h.
◆ SkWriter32()
SkWriter32::SkWriter32 |
( |
void * |
external = nullptr , |
|
|
size_t |
externalBytes = 0 |
|
) |
| |
|
inline |
The caller can specify an initial block of storage, which the caller manages.
SkWriter32 will try to back reserve and write calls with this external storage until the first time an allocation doesn't fit. From then it will use dynamically allocated storage. This used to be optional behavior, but pipe now relies on it.
Definition at line 43 of file SkWriter32.h.
43 {
44 this->
reset(external, externalBytes);
45 }
void reset(void *external=nullptr, size_t externalBytes=0)
◆ bytesWritten()
size_t SkWriter32::bytesWritten |
( |
| ) |
const |
|
inline |
◆ flatten()
void SkWriter32::flatten |
( |
void * |
dst | ) |
const |
|
inline |
◆ overwriteTAt()
void SkWriter32::overwriteTAt |
( |
size_t |
offset, |
|
|
const T & |
value |
|
) |
| |
|
inline |
Overwrite a T record at offset, which must be a multiple of 4. Only legal if the record was written atomically using the write methods below.
Definition at line 94 of file SkWriter32.h.
94 {
98 }
static constexpr T SkAlign4(T x)
◆ readFromStream()
size_t SkWriter32::readFromStream |
( |
SkStream * |
stream, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Definition at line 245 of file SkWriter32.h.
245 {
247 }
uint32_t * reservePad(size_t size)
◆ readTAt()
const T & SkWriter32::readTAt |
( |
size_t |
offset | ) |
const |
|
inline |
Read a T record at offset, which must be a multiple of 4. Only legal if the record was written atomically using the write methods below.
Definition at line 83 of file SkWriter32.h.
◆ reserve()
uint32_t * SkWriter32::reserve |
( |
size_t |
size | ) |
|
|
inline |
Definition at line 67 of file SkWriter32.h.
67 {
70 size_t totalRequired = fUsed +
size;
71 if (totalRequired > fCapacity) {
72 this->growToAtLeast(totalRequired);
73 }
74 fUsed = totalRequired;
75 return (uint32_t*)(fData +
offset);
76 }
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
◆ reservePad()
uint32_t * SkWriter32::reservePad |
( |
size_t |
size | ) |
|
|
inline |
Reserve size bytes. Does not need to be 4 byte aligned. The remaining space (if any) will be filled in with zeroes.
Definition at line 179 of file SkWriter32.h.
179 {
181 uint32_t*
p = this->
reserve(alignedSize);
182 if (alignedSize !=
size) {
184 p[alignedSize / 4 - 1] = 0;
185 }
187 }
uint32_t * reserve(size_t size)
◆ reset()
void SkWriter32::reset |
( |
void * |
external = nullptr , |
|
|
size_t |
externalBytes = 0 |
|
) |
| |
|
inline |
Definition at line 54 of file SkWriter32.h.
54 {
55
57
58 externalBytes &= ~3;
59
60 fData = (uint8_t*)external;
61 fCapacity = externalBytes;
62 fUsed = 0;
63 fExternal = external;
64 }
static constexpr bool SkIsAlign4(T x)
◆ rewindToOffset()
void SkWriter32::rewindToOffset |
( |
size_t |
offset | ) |
|
|
inline |
Move the cursor back to offset bytes from the beginning. offset must be a multiple of 4 no greater than size().
Definition at line 228 of file SkWriter32.h.
228 {
232 }
size_t bytesWritten() const
◆ snapshotAsData()
Captures a snapshot of the data as it is right now, and return it.
Definition at line 78 of file SkWriter32.cpp.
78 {
80}
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
◆ usingInitialStorage()
bool SkWriter32::usingInitialStorage |
( |
| ) |
const |
|
inline |
Definition at line 52 of file SkWriter32.h.
52{ return fData == fExternal; }
◆ write()
void SkWriter32::write |
( |
const void * |
values, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Write size bytes from values. size must be a multiple of 4, though values need not be 4-byte aligned.
Definition at line 170 of file SkWriter32.h.
170 {
173 }
static void * sk_careful_memcpy(void *dst, const void *src, size_t len)
◆ write16()
void SkWriter32::write16 |
( |
int32_t |
value | ) |
|
|
inline |
◆ write32()
void SkWriter32::write32 |
( |
int32_t |
value | ) |
|
|
inline |
◆ write8()
void SkWriter32::write8 |
( |
int32_t |
value | ) |
|
|
inline |
◆ writeBool()
bool SkWriter32::writeBool |
( |
bool |
value | ) |
|
|
inline |
Definition at line 100 of file SkWriter32.h.
100 {
103 }
void write32(int32_t value)
◆ writeData()
void SkWriter32::writeData |
( |
const SkData * |
data | ) |
|
|
inline |
Definition at line 212 of file SkWriter32.h.
212 {
217 }
218 }
constexpr uint32_t SkToU32(S x)
const void * data() const
void writePad(const void *src, size_t size)
std::shared_ptr< const fml::Mapping > data
◆ WriteDataSize()
static size_t SkWriter32::WriteDataSize |
( |
const SkData * |
data | ) |
|
|
inlinestatic |
◆ writeInt()
void SkWriter32::writeInt |
( |
int32_t |
value | ) |
|
|
inline |
◆ writeIRect()
void SkWriter32::writeIRect |
( |
const SkIRect & |
rect | ) |
|
|
inline |
Definition at line 137 of file SkWriter32.h.
137 {
139 }
sk_sp< SkBlender > blender SkRect rect
◆ writeMatrix()
void SkWriter32::writeMatrix |
( |
const SkMatrix & |
matrix | ) |
|
Definition at line 18 of file SkWriter32.cpp.
18 {
22}
static size_t WriteToMemory(const SkMatrix &matrix, void *buffer)
unsigned useCenter Optional< SkMatrix > matrix
◆ writeMul4()
void SkWriter32::writeMul4 |
( |
const void * |
values, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Definition at line 162 of file SkWriter32.h.
162 {
164 }
void write(const void *values, size_t size)
◆ writePad()
void SkWriter32::writePad |
( |
const void * |
src, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Write size bytes from src, and pad to 4 byte alignment with zeroes.
Definition at line 192 of file SkWriter32.h.
◆ writePath()
void SkWriter32::writePath |
( |
const SkPath & |
path | ) |
|
|
inline |
Definition at line 145 of file SkWriter32.h.
145 {
146 size_t size =
path.writeToMemory(
nullptr);
149 }
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
◆ writePoint()
void SkWriter32::writePoint |
( |
const SkPoint & |
pt | ) |
|
|
inline |
◆ writePoint3()
void SkWriter32::writePoint3 |
( |
const SkPoint3 & |
pt | ) |
|
|
inline |
◆ writeRect()
void SkWriter32::writeRect |
( |
const SkRect & |
rect | ) |
|
|
inline |
◆ writeRegion()
void SkWriter32::writeRegion |
( |
const SkRegion & |
rgn | ) |
|
|
inline |
Definition at line 153 of file SkWriter32.h.
153 {
157 }
size_t writeToMemory(void *buffer) const
◆ writeRRect()
void SkWriter32::writeRRect |
( |
const SkRRect & |
rrect | ) |
|
|
inline |
Definition at line 141 of file SkWriter32.h.
141 {
143 }
size_t writeToMemory(void *buffer) const
static constexpr size_t kSizeInMemory
◆ writeSampling()
Definition at line 24 of file SkWriter32.cpp.
24 {
31 } else {
34 }
35 }
36}
void writeScalar(SkScalar value)
bool writeBool(bool value)
SkSamplingOptions sampling
const SkCubicResampler cubic
const SkFilterMode filter
const SkMipmapMode mipmap
◆ writeScalar()
void SkWriter32::writeScalar |
( |
SkScalar |
value | ) |
|
|
inline |
◆ writeString()
void SkWriter32::writeString |
( |
const char * |
str, |
|
|
size_t |
len = (size_t)-1 |
|
) |
| |
Writes a string to the writer, which can be retrieved with SkReadBuffer::readString(). The length can be specified, or if -1 is passed, it will be computed by calling strlen(). The length must be < max size_t.
If you write NULL, it will be read as "".
Definition at line 38 of file SkWriter32.cpp.
38 {
39 if (nullptr == str) {
40 str = "";
42 }
45 }
46
47
50 char* chars = (char*)(ptr + 1);
51 memcpy(chars, str,
len);
53}
◆ WriteStringSize()
size_t SkWriter32::WriteStringSize |
( |
const char * |
str, |
|
|
size_t |
len = (size_t)-1 |
|
) |
| |
|
static |
Computes the size (aligned to multiple of 4) need to write the string in a call to writeString(). If the length is not specified, it will be computed by calling strlen().
Definition at line 55 of file SkWriter32.cpp.
55 {
59 }
60 const size_t lenBytes = 4;
61
63}
◆ writeToStream()
bool SkWriter32::writeToStream |
( |
SkWStream * |
stream | ) |
const |
|
inline |
The documentation for this class was generated from the following files: