Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkBinaryWriteBuffer Class Reference

#include <SkWriteBuffer.h>

Inheritance diagram for SkBinaryWriteBuffer:
SkWriteBuffer

Public Member Functions

 SkBinaryWriteBuffer (const SkSerialProcs &)
 
 SkBinaryWriteBuffer (void *initialStorage, size_t storageSize, const SkSerialProcs &)
 
 ~SkBinaryWriteBuffer () override
 
void write (const void *buffer, size_t bytes)
 
void writePad32 (const void *buffer, size_t bytes) override
 
void reset (void *storage=nullptr, size_t storageSize=0)
 
size_t bytesWritten () const
 
bool usingInitialStorage () const
 
void writeByteArray (const void *data, size_t size) override
 
void writeBool (bool value) override
 
void writeScalar (SkScalar value) override
 
void writeScalarArray (const SkScalar *value, uint32_t count) override
 
void writeInt (int32_t value) override
 
void writeIntArray (const int32_t *value, uint32_t count) override
 
void writeUInt (uint32_t value) override
 
void writeString (std::string_view value) override
 
void writeFlattenable (const SkFlattenable *flattenable) override
 
void writeColor (SkColor color) override
 
void writeColorArray (const SkColor *color, uint32_t count) override
 
void writeColor4f (const SkColor4f &color) override
 
void writeColor4fArray (const SkColor4f *color, uint32_t count) override
 
void writePoint (const SkPoint &point) override
 
void writePointArray (const SkPoint *point, uint32_t count) override
 
void writePoint3 (const SkPoint3 &point) override
 
void write (const SkM44 &) override
 
void writeMatrix (const SkMatrix &matrix) override
 
void writeIRect (const SkIRect &rect) override
 
void writeRect (const SkRect &rect) override
 
void writeRegion (const SkRegion &region) override
 
void writeSampling (const SkSamplingOptions &) override
 
void writePath (const SkPath &path) override
 
size_t writeStream (SkStream *stream, size_t length) override
 
void writeImage (const SkImage *) override
 
void writeTypeface (SkTypeface *typeface) override
 
void writePaint (const SkPaint &paint) override
 
bool writeToStream (SkWStream *) const
 
void writeToMemory (void *dst) const
 
sk_sp< SkDatasnapshotAsData () const
 
void setFactoryRecorder (sk_sp< SkFactorySet >)
 
void setTypefaceRecorder (sk_sp< SkRefCntSet >)
 
- Public Member Functions inherited from SkWriteBuffer
 SkWriteBuffer (const SkSerialProcs &p)
 
virtual ~SkWriteBuffer ()
 
virtual void writePad32 (const void *buffer, size_t bytes)=0
 
virtual void writeByteArray (const void *data, size_t size)=0
 
void writeDataAsByteArray (const SkData *data)
 
virtual void writeBool (bool value)=0
 
virtual void writeScalar (SkScalar value)=0
 
virtual void writeScalarArray (const SkScalar *value, uint32_t count)=0
 
virtual void writeInt (int32_t value)=0
 
virtual void writeIntArray (const int32_t *value, uint32_t count)=0
 
virtual void writeUInt (uint32_t value)=0
 
void write32 (int32_t value)
 
virtual void writeString (std::string_view value)=0
 
virtual void writeFlattenable (const SkFlattenable *flattenable)=0
 
virtual void writeColor (SkColor color)=0
 
virtual void writeColorArray (const SkColor *color, uint32_t count)=0
 
virtual void writeColor4f (const SkColor4f &color)=0
 
virtual void writeColor4fArray (const SkColor4f *color, uint32_t count)=0
 
virtual void writePoint (const SkPoint &point)=0
 
virtual void writePointArray (const SkPoint *point, uint32_t count)=0
 
virtual void writePoint3 (const SkPoint3 &point)=0
 
virtual void write (const SkM44 &)=0
 
virtual void writeMatrix (const SkMatrix &matrix)=0
 
virtual void writeIRect (const SkIRect &rect)=0
 
virtual void writeRect (const SkRect &rect)=0
 
virtual void writeRegion (const SkRegion &region)=0
 
virtual void writeSampling (const SkSamplingOptions &)=0
 
virtual void writePath (const SkPath &path)=0
 
virtual size_t writeStream (SkStream *stream, size_t length)=0
 
virtual void writeImage (const SkImage *)=0
 
virtual void writeTypeface (SkTypeface *typeface)=0
 
virtual void writePaint (const SkPaint &paint)=0
 
const SkSerialProcsserialProcs () const
 

Additional Inherited Members

- Protected Attributes inherited from SkWriteBuffer
SkSerialProcs fProcs
 

Detailed Description

Concrete implementation that serializes to a flat binary blob.

Definition at line 97 of file SkWriteBuffer.h.

Constructor & Destructor Documentation

◆ SkBinaryWriteBuffer() [1/2]

SkBinaryWriteBuffer::SkBinaryWriteBuffer ( const SkSerialProcs p)

Definition at line 42 of file SkWriteBuffer.cpp.

43 : SkWriteBuffer(p), fFactorySet(nullptr), fTFSet(nullptr) {}
SkWriteBuffer(const SkSerialProcs &p)
Definition: SkWriteBuffer.h:43

◆ SkBinaryWriteBuffer() [2/2]

SkBinaryWriteBuffer::SkBinaryWriteBuffer ( void *  initialStorage,
size_t  storageSize,
const SkSerialProcs p 
)

Definition at line 45 of file SkWriteBuffer.cpp.

46 : SkWriteBuffer(p), fFactorySet(nullptr), fTFSet(nullptr), fWriter(storage, storageSize) {}

◆ ~SkBinaryWriteBuffer()

SkBinaryWriteBuffer::~SkBinaryWriteBuffer ( )
override

Definition at line 48 of file SkWriteBuffer.cpp.

48{}

Member Function Documentation

◆ bytesWritten()

size_t SkBinaryWriteBuffer::bytesWritten ( ) const
inline

Definition at line 114 of file SkWriteBuffer.h.

114{ return fWriter.bytesWritten(); }
size_t bytesWritten() const
Definition: SkWriter32.h:48

◆ reset()

void SkBinaryWriteBuffer::reset ( void *  storage = nullptr,
size_t  storageSize = 0 
)
inline

Definition at line 110 of file SkWriteBuffer.h.

110 {
111 fWriter.reset(storage, storageSize);
112 }
void reset(void *external=nullptr, size_t externalBytes=0)
Definition: SkWriter32.h:54

◆ setFactoryRecorder()

void SkBinaryWriteBuffer::setFactoryRecorder ( sk_sp< SkFactorySet rec)

Definition at line 274 of file SkWriteBuffer.cpp.

274 {
275 fFactorySet = std::move(rec);
276}

◆ setTypefaceRecorder()

void SkBinaryWriteBuffer::setTypefaceRecorder ( sk_sp< SkRefCntSet rec)

Definition at line 278 of file SkWriteBuffer.cpp.

278 {
279 fTFSet = std::move(rec);
280}

◆ snapshotAsData()

sk_sp< SkData > SkBinaryWriteBuffer::snapshotAsData ( ) const
inline

Definition at line 151 of file SkWriteBuffer.h.

151{ return fWriter.snapshotAsData(); }
sk_sp< SkData > snapshotAsData() const
Definition: SkWriter32.cpp:78

◆ usingInitialStorage()

bool SkBinaryWriteBuffer::usingInitialStorage ( ) const

Definition at line 50 of file SkWriteBuffer.cpp.

50 {
51 return fWriter.usingInitialStorage();
52}
bool usingInitialStorage() const
Definition: SkWriter32.h:52

◆ write() [1/2]

void SkBinaryWriteBuffer::write ( const SkM44 matrix)
overridevirtual

Implements SkWriteBuffer.

Definition at line 121 of file SkWriteBuffer.cpp.

121 {
122 fWriter.write(SkMatrixPriv::M44ColMajor(matrix), sizeof(float) * 16);
123}
static const SkScalar * M44ColMajor(const SkM44 &m)
Definition: SkMatrixPriv.h:185
void write(const void *values, size_t size)
Definition: SkWriter32.h:170
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ write() [2/2]

void SkBinaryWriteBuffer::write ( const void *  buffer,
size_t  bytes 
)
inline

Definition at line 103 of file SkWriteBuffer.h.

103 {
104 fWriter.write(buffer, bytes);
105 }
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

◆ writeBool()

void SkBinaryWriteBuffer::writeBool ( bool  value)
overridevirtual

Implements SkWriteBuffer.

Definition at line 59 of file SkWriteBuffer.cpp.

59 {
60 fWriter.writeBool(value);
61}
bool writeBool(bool value)
Definition: SkWriter32.h:100
uint8_t value

◆ writeByteArray()

void SkBinaryWriteBuffer::writeByteArray ( const void *  data,
size_t  size 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 54 of file SkWriteBuffer.cpp.

54 {
55 fWriter.write32(SkToU32(size));
56 fWriter.writePad(data, size);
57}
constexpr uint32_t SkToU32(S x)
Definition: SkTo.h:26
void write32(int32_t value)
Definition: SkWriter32.h:117
void writePad(const void *src, size_t size)
Definition: SkWriter32.h:192
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
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ writeColor()

void SkBinaryWriteBuffer::writeColor ( SkColor  color)
overridevirtual

Implements SkWriteBuffer.

Definition at line 89 of file SkWriteBuffer.cpp.

89 {
90 fWriter.write32(color);
91}
DlColor color

◆ writeColor4f()

void SkBinaryWriteBuffer::writeColor4f ( const SkColor4f color)
overridevirtual

Implements SkWriteBuffer.

Definition at line 98 of file SkWriteBuffer.cpp.

98 {
99 fWriter.write(&color, sizeof(SkColor4f));
100}

◆ writeColor4fArray()

void SkBinaryWriteBuffer::writeColor4fArray ( const SkColor4f color,
uint32_t  count 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 102 of file SkWriteBuffer.cpp.

102 {
103 fWriter.write32(count);
104 fWriter.write(color, count * sizeof(SkColor4f));
105}
int count
Definition: FontMgrTest.cpp:50

◆ writeColorArray()

void SkBinaryWriteBuffer::writeColorArray ( const SkColor color,
uint32_t  count 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 93 of file SkWriteBuffer.cpp.

93 {
94 fWriter.write32(count);
95 fWriter.write(color, count * sizeof(SkColor));
96}
uint32_t SkColor
Definition: SkColor.h:37

◆ writeFlattenable()

void SkBinaryWriteBuffer::writeFlattenable ( const SkFlattenable flattenable)
overridevirtual

Implements SkWriteBuffer.

Definition at line 282 of file SkWriteBuffer.cpp.

282 {
283 if (nullptr == flattenable) {
284 this->write32(0);
285 return;
286 }
287
288 /*
289 * We can write 1 of 2 versions of the flattenable:
290 *
291 * 1. index into fFactorySet: This assumes the writer will later resolve the function-ptrs
292 * into strings for its reader. SkPicture does exactly this, by writing a table of names
293 * (matching the indices) up front in its serialized form.
294 *
295 * 2. string name of the flattenable or index into fFlattenableDict: We store the string to
296 * allow the reader to specify its own factories after write time. In order to improve
297 * compression, if we have already written the string, we write its index instead.
298 */
299
300 if (SkFlattenable::Factory factory = flattenable->getFactory(); factory && fFactorySet) {
301 this->write32(fFactorySet->add(factory));
302 } else {
303 const char* name = flattenable->getTypeName();
304 SkASSERT(name);
305 SkASSERT(0 != strcmp("", name));
306
307 if (uint32_t* indexPtr = fFlattenableDict.find(name)) {
308 // We will write the index as a 32-bit int. We want the first byte
309 // that we send to be zero - this will act as a sentinel that we
310 // have an index (not a string). This means that we will send the
311 // the index shifted left by 8. The remaining 24-bits should be
312 // plenty to store the index. Note that this strategy depends on
313 // being little endian, and type names being non-empty.
314 SkASSERT(0 == *indexPtr >> 24);
315 this->write32(*indexPtr << 8);
316 } else {
317 this->writeString(name);
318 fFlattenableDict.set(name, fFlattenableDict.count() + 1);
319 }
320 }
321
322 // make room for the size of the flattened object
323 (void)fWriter.reserve(sizeof(uint32_t));
324 // record the current size, so we can subtract after the object writes.
325 size_t offset = fWriter.bytesWritten();
326 // now flatten the object
327 flattenable->flatten(*this);
328 size_t objSize = fWriter.bytesWritten() - offset;
329 // record the obj's size
330 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize));
331}
#define SkASSERT(cond)
Definition: SkAssert.h:116
void writeString(std::string_view value) override
virtual void flatten(SkWriteBuffer &) const
Definition: SkFlattenable.h:67
sk_sp< SkFlattenable >(* Factory)(SkReadBuffer &)
Definition: SkFlattenable.h:41
virtual const char * getTypeName() const =0
virtual Factory getFactory() const =0
uint32_t add(T ptr)
void write32(int32_t value)
Definition: SkWriteBuffer.h:63
void overwriteTAt(size_t offset, const T &value)
Definition: SkWriter32.h:94
uint32_t * reserve(size_t size)
Definition: SkWriter32.h:67
int count() const
Definition: SkTHash.h:471
V * find(const K &key) const
Definition: SkTHash.h:494
V * set(K key, V val)
Definition: SkTHash.h:487
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
SeparatedVector2 offset

◆ writeImage()

void SkBinaryWriteBuffer::writeImage ( const SkImage image)
overridevirtual

Implements SkWriteBuffer.

Definition at line 221 of file SkWriteBuffer.cpp.

221 {
222 uint32_t flags = 0;
223 const SkMipmap* mips = as_IB(image)->onPeekMips();
224 if (mips) {
226 }
229 }
230
231 this->write32(flags);
232
234 SkASSERT(data);
235 this->writeDataAsByteArray(data.get());
236
238 sk_sp<SkData> mipData = serialize_mipmap(mips, fProcs);
239 this->writeDataAsByteArray(mipData.get());
240 }
241}
kUnpremul_SkAlphaType
static SkImage_Base * as_IB(SkImage *image)
Definition: SkImage_Base.h:201
static sk_sp< SkData > serialize_image(const SkImage *image, SkSerialProcs procs)
static sk_sp< SkData > serialize_mipmap(const SkMipmap *mipmap, SkSerialProcs procs)
@ kUnpremul
@ kHasMipmap
virtual SkMipmap * onPeekMips() const
Definition: SkImage_Base.h:84
SkAlphaType alphaType() const
Definition: SkImage.cpp:154
void writeDataAsByteArray(const SkData *data)
Definition: SkWriteBuffer.h:49
SkSerialProcs fProcs
Definition: SkWriteBuffer.h:91
T * get() const
Definition: SkRefCnt.h:303
FlutterSemanticsFlag flags
sk_sp< const SkImage > image
Definition: SkRecords.h:269

◆ writeInt()

void SkBinaryWriteBuffer::writeInt ( int32_t  value)
overridevirtual

Implements SkWriteBuffer.

Definition at line 72 of file SkWriteBuffer.cpp.

72 {
73 fWriter.write32(value);
74}

◆ writeIntArray()

void SkBinaryWriteBuffer::writeIntArray ( const int32_t *  value,
uint32_t  count 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 76 of file SkWriteBuffer.cpp.

76 {
77 fWriter.write32(count);
78 fWriter.write(value, count * sizeof(int32_t));
79}

◆ writeIRect()

void SkBinaryWriteBuffer::writeIRect ( const SkIRect rect)
overridevirtual

Implements SkWriteBuffer.

Definition at line 129 of file SkWriteBuffer.cpp.

129 {
130 fWriter.write(&rect, sizeof(SkIRect));
131}
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
Definition: SkRect.h:32

◆ writeMatrix()

void SkBinaryWriteBuffer::writeMatrix ( const SkMatrix matrix)
overridevirtual

Implements SkWriteBuffer.

Definition at line 125 of file SkWriteBuffer.cpp.

125 {
126 fWriter.writeMatrix(matrix);
127}
void writeMatrix(const SkMatrix &matrix)
Definition: SkWriter32.cpp:18

◆ writePad32()

void SkBinaryWriteBuffer::writePad32 ( const void *  buffer,
size_t  bytes 
)
inlineoverridevirtual

Implements SkWriteBuffer.

Definition at line 106 of file SkWriteBuffer.h.

106 {
107 fWriter.writePad(buffer, bytes);
108 }

◆ writePaint()

void SkBinaryWriteBuffer::writePaint ( const SkPaint paint)
overridevirtual

Implements SkWriteBuffer.

Definition at line 270 of file SkWriteBuffer.cpp.

270 {
272}
static void Flatten(const SkPaint &paint, SkWriteBuffer &buffer)
const Paint & paint
Definition: color_source.cc:38

◆ writePath()

void SkBinaryWriteBuffer::writePath ( const SkPath path)
overridevirtual

Implements SkWriteBuffer.

Definition at line 145 of file SkWriteBuffer.cpp.

145 {
146 fWriter.writePath(path);
147}
void writePath(const SkPath &path)
Definition: SkWriter32.h:145
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
Definition: switches.h:57

◆ writePoint()

void SkBinaryWriteBuffer::writePoint ( const SkPoint point)
overridevirtual

Implements SkWriteBuffer.

Definition at line 107 of file SkWriteBuffer.cpp.

107 {
108 fWriter.writeScalar(point.fX);
109 fWriter.writeScalar(point.fY);
110}
void writeScalar(SkScalar value)
Definition: SkWriter32.h:121
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165

◆ writePoint3()

void SkBinaryWriteBuffer::writePoint3 ( const SkPoint3 point)
overridevirtual

Implements SkWriteBuffer.

Definition at line 112 of file SkWriteBuffer.cpp.

112 {
113 this->writePad32(&point, sizeof(SkPoint3));
114}
void writePad32(const void *buffer, size_t bytes) override

◆ writePointArray()

void SkBinaryWriteBuffer::writePointArray ( const SkPoint point,
uint32_t  count 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 116 of file SkWriteBuffer.cpp.

116 {
117 fWriter.write32(count);
118 fWriter.write(point, count * sizeof(SkPoint));
119}

◆ writeRect()

void SkBinaryWriteBuffer::writeRect ( const SkRect rect)
overridevirtual

Implements SkWriteBuffer.

Definition at line 133 of file SkWriteBuffer.cpp.

133 {
134 fWriter.writeRect(rect);
135}
void writeRect(const SkRect &rect)
Definition: SkWriter32.h:133

◆ writeRegion()

void SkBinaryWriteBuffer::writeRegion ( const SkRegion region)
overridevirtual

Implements SkWriteBuffer.

Definition at line 137 of file SkWriteBuffer.cpp.

137 {
138 fWriter.writeRegion(region);
139}
void writeRegion(const SkRegion &rgn)
Definition: SkWriter32.h:153
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238

◆ writeSampling()

void SkBinaryWriteBuffer::writeSampling ( const SkSamplingOptions sampling)
overridevirtual

Implements SkWriteBuffer.

Definition at line 141 of file SkWriteBuffer.cpp.

141 {
142 fWriter.writeSampling(sampling);
143}
void writeSampling(const SkSamplingOptions &sampling)
Definition: SkWriter32.cpp:24
SkSamplingOptions sampling
Definition: SkRecords.h:337

◆ writeScalar()

void SkBinaryWriteBuffer::writeScalar ( SkScalar  value)
overridevirtual

Implements SkWriteBuffer.

Definition at line 63 of file SkWriteBuffer.cpp.

63 {
64 fWriter.writeScalar(value);
65}

◆ writeScalarArray()

void SkBinaryWriteBuffer::writeScalarArray ( const SkScalar value,
uint32_t  count 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 67 of file SkWriteBuffer.cpp.

67 {
68 fWriter.write32(count);
69 fWriter.write(value, count * sizeof(SkScalar));
70}
float SkScalar
Definition: extension.cpp:12

◆ writeStream()

size_t SkBinaryWriteBuffer::writeStream ( SkStream stream,
size_t  length 
)
overridevirtual

Implements SkWriteBuffer.

Definition at line 149 of file SkWriteBuffer.cpp.

149 {
150 fWriter.write32(SkToU32(length));
151 size_t bytesWritten = fWriter.readFromStream(stream, length);
152 if (bytesWritten < length) {
153 fWriter.reservePad(length - bytesWritten);
154 }
155 return bytesWritten;
156}
size_t bytesWritten() const
uint32_t * reservePad(size_t size)
Definition: SkWriter32.h:179
size_t readFromStream(SkStream *stream, size_t length)
Definition: SkWriter32.h:245
size_t length

◆ writeString()

void SkBinaryWriteBuffer::writeString ( std::string_view  value)
overridevirtual

Implements SkWriteBuffer.

Definition at line 85 of file SkWriteBuffer.cpp.

85 {
86 fWriter.writeString(value.data(), value.size());
87}
void writeString(const char *str, size_t len=(size_t) -1)
Definition: SkWriter32.cpp:38

◆ writeToMemory()

void SkBinaryWriteBuffer::writeToMemory ( void *  dst) const
inline

Definition at line 150 of file SkWriteBuffer.h.

150{ fWriter.flatten(dst); }
void flatten(void *dst) const
Definition: SkWriter32.h:235
dst
Definition: cp.py:12

◆ writeToStream()

bool SkBinaryWriteBuffer::writeToStream ( SkWStream stream) const

Definition at line 158 of file SkWriteBuffer.cpp.

158 {
159 return fWriter.writeToStream(stream);
160}
bool writeToStream(SkWStream *stream) const
Definition: SkWriter32.h:239

◆ writeTypeface()

void SkBinaryWriteBuffer::writeTypeface ( SkTypeface typeface)
overridevirtual

Implements SkWriteBuffer.

Definition at line 243 of file SkWriteBuffer.cpp.

243 {
244 // Write 32 bits (signed)
245 // 0 -- empty font
246 // >0 -- index
247 // <0 -- custom (serial procs)
248
249 if (obj == nullptr) {
250 fWriter.write32(0);
251 } else if (fProcs.fTypefaceProc) {
253 if (data) {
254 size_t size = data->size();
255 if (!SkTFitsIn<int32_t>(size)) {
256 size = 0; // fall back to default font
257 }
258 int32_t ssize = SkToS32(size);
259 fWriter.write32(-ssize); // negative to signal custom
260 if (size) {
261 this->writePad32(data->data(), size);
262 }
263 return;
264 }
265 // no data means fall through for std behavior
266 }
267 fWriter.write32(fTFSet ? fTFSet->add(obj) : 0);
268}
constexpr int32_t SkToS32(S x)
Definition: SkTo.h:25
void * fTypefaceCtx
Definition: SkSerialProcs.h:94
SkSerialTypefaceProc fTypefaceProc
Definition: SkSerialProcs.h:93

◆ writeUInt()

void SkBinaryWriteBuffer::writeUInt ( uint32_t  value)
overridevirtual

Implements SkWriteBuffer.

Definition at line 81 of file SkWriteBuffer.cpp.

81 {
82 fWriter.write32(value);
83}

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