Either get a free slot, or the oldest one
| 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 | { |