// // Textblob data is laid out into externally-managed storage as follows: // // ----------------------------------------------------------------------------- // | SkTextBlob | RunRecord | Glyphs[] | Pos[] | RunRecord | Glyphs[] | Pos[] | ... // ----------------------------------------------------------------------------- // // Each run record describes a text blob run, and can be used to determine the (implicit) // location of the following record. // // Extended Textblob runs have more data after the Pos[] array: // // ------------------------------------------------------------------------- // ... | RunRecord | Glyphs[] | Pos[] | TextSize | Clusters[] | Text[] | ... // ------------------------------------------------------------------------- // // To determine the length of the extended run data, the TextSize must be read. // // Extended Textblob runs may be mixed with non-extended runs.
SkGlyphID* glyphBuffer() const {
static_assert(SkIsAlignPtr(sizeof(RunRecord)), ""); // Glyphs are stored immediately following the record. return reinterpret_cast<SkGlyphID*>(const_cast<RunRecord*>(this) + 1);
}
// can be aliased with pointBuffer() or xformBuffer()
SkScalar* posBuffer() const { // Position scalars follow the (aligned) glyph buffer. return reinterpret_cast<SkScalar*>(reinterpret_cast<uint8_t*>(this->glyphBuffer()) +
SkAlign4(fCount * sizeof(SkGlyphID)));
}
// alias for posBuffer()
SkPoint* pointBuffer() const {
SkASSERT(this->positioning() == (GlyphPositioning)2); return reinterpret_cast<SkPoint*>(this->posBuffer());
}
// alias for posBuffer()
SkRSXform* xformBuffer() const {
SkASSERT(this->positioning() == (GlyphPositioning)3); return reinterpret_cast<SkRSXform*>(this->posBuffer());
}
enum Flags {
kPositioning_Mask = 0x03, // bits 0-1 reserved for positioning
kLast_Flag = 0x04, // set for the last blob run
kExtended_Flag = 0x08, // set for runs with text/cluster info
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.