MCPcopy Create free account
hub / github.com/defold/defold / AcquireFreeGlyphFromCache

Function AcquireFreeGlyphFromCache

engine/render/src/render/font/fontmap.cpp:708–718  ·  view source on GitHub ↗

Either get a free slot, or the oldest one

Source from the content-addressed store, hash-verified

706
707 // Either get a free slot, or the oldest one
708 static CacheGlyph* AcquireFreeGlyphFromCache(HFontMap font_map)
709 {
710 uint32_t i;
711 if (font_map->m_CacheCursor < font_map->m_CacheCellCount)
712 i = font_map->m_CacheCursor++; // Get the unused slot
713 else
714 i = font_map->m_CacheCellCount-1; // Get the oldest slot
715
716 uint32_t index = font_map->m_CacheIndices[i];
717 return &font_map->m_Cache[index];
718 }
719
720 CacheGlyph* GetFromCache(HFontMap font_map, uint64_t glyph_key, uint32_t frame)
721 {

Callers 1

AddGlyphToCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected