27 std::vector<SkTextBlobTrace::Record> trace;
29 uint32_t typefaceCount;
30 if (!
stream->readU32(&typefaceCount)) {
34 std::vector<sk_sp<SkTypeface>> typefaceArray;
35 for (uint32_t
i = 0;
i < typefaceCount;
i++) {
40 if (!
stream->readU32(&restOfFile)) {
45 readBuffer.setTypefaceArray(typefaceArray.data(), typefaceArray.size());
47 while (!readBuffer.eof()) {
50 record.
paint = readBuffer.readPaint();
51 readBuffer.readPoint(&record.
offset);
53 trace.push_back(std::move(record));
63 ||
p.getMaskFilter() !=
nullptr
64 ||
p.getPathEffect() !=
nullptr;
67 blob->
uniqueID(), record.offset.x(), record.offset.y(), weirdPaint);
70 while (!iter.
done()) {
73 SkDebugf(
"Font %u %g %g %g %d %d %d\n ",
74 font.getTypeface()->uniqueID(),
79 (
int)
font.getEdging(),
80 (
int)
font.getHinting());
83 for (uint32_t
i = 0;
i < glyphCount;
i++) {
94 fWriteBuffer.setTypefaceRecorder(fTypefaceSet);
102 if (blob !=
nullptr) {
103 fWriteBuffer.writeUInt(blob->
uniqueID());
104 fWriteBuffer.writePaint(
paint);
105 fWriteBuffer.writePoint(glyphRunList.
origin());
118 SkDebugf(
"Error opening '%s'.\n",
f.c_str());
121 SkDebugf(
"Saving trace to '%s'.\n",
f.c_str());
124 int count = fTypefaceSet->count();
127 while (
void* ptr = iter.
next()) {
130 dst->write32(fWriteBuffer.bytesWritten());
131 fWriteBuffer.writeToStream(
dst);
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
static sk_sp< SkData > MakeFromStream(SkStream *, size_t size)
static uint8_t Flags(const SkFont &font)
@ kFill_Style
set to fill geometry
T * init(Args &&... args)
static void Flatten(const SkTextBlob &, SkWriteBuffer &)
static sk_sp< SkTextBlob > MakeFromBuffer(SkReadBuffer &)
const uint16_t * glyphs() const
uint32_t glyphCount() const
const SkFont & font() const
void capture(const sktext::GlyphRunList &, const SkPaint &)
void dump(SkWStream *dst=nullptr) const
uint32_t uniqueID() const
static sk_sp< SkTypeface > MakeDeserialize(SkStream *, sk_sp< SkFontMgr > lastResortMgr)
const SkTextBlob * blob() const
static uint32_t Mix(uint32_t hash)
std::vector< SkTextBlobTrace::Record > CreateBlobTrace(SkStream *stream, sk_sp< SkFontMgr > lastResortMgr)
void DumpTrace(const std::vector< SkTextBlobTrace::Record > &)
font
Font Metadata and Metrics.
std::shared_ptr< const fml::Mapping > data