// Both backends currently store pointer-sized types for glyphs and 88 is currently sufficient for // Ganesh and Graphite's BackendData. static constexpr size_t kMaxGlyphTypeSize = sizeof(void*); static constexpr size_t kMaxBackendDataSize = 88;
template <typename T>
concept GlyphType = requires(const T& t) {
requires sizeof(T) <= kMaxGlyphTypeSize; // We store these in an array with kMaxGlyphTypeSize per entry. So that alignment must be // sufficient.
requires alignof(T) <= kMaxGlyphTypeSize;
// Must have a makeGlyphFromID that returns a GlyphType
{ t.makeGlyphFromID(id, maskFormat) } -> GlyphType;
};
} // namespace GlyphVector_Concepts
// -- GlyphVector ---------------------------------------------------------------------------------- // GlyphVector provides a way to delay the lookup of Glyphs until the code is running on the GPU // in single threaded mode. The GlyphVector is created in a multi-threaded environment, but the // StrikeCache is only single threaded (and must be single threaded because of the atlas). // // Once in the single-threaded GPU environment the glyph packed IDs are converted into a GPU backend // specific entry type from which each glyph's atlas location can be determined. class GlyphVector {
using GlyphBytes = std::array<std::byte, GlyphVector_Concepts::kMaxGlyphTypeSize>;
using BackendDataBytes = std::array<std::byte, GlyphVector_Concepts::kMaxBackendDataSize>;
// Get the specific TextStrikeBase-derived strike class and GlyphType-conforming types yieled // by a BackendData-conforming type. template <GlyphVector_Concepts::BackendData B>
using Strike = std::invoke_result_t<decltype(B::FindStrike), StrikeCache*, const SkStrikeSpec&>;
template <GlyphVector_Concepts::BackendData B>
using Glyph = decltype(std::declval<B>().makeGlyphFromID(SkPackedGlyphID{},
skgpu::MaskFormat::kARGB));
// This doesn't need to include sizeof(GlyphVector) because this is embedded in each of // the sub runs. int unflattenSize() const { return Size(fGlyphs.size()); }
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.