| 120 | } |
| 121 | |
| 122 | std::optional<TextShaperCacheValue> TextShaperCache::find(const TextShaperCacheKey& key) { |
| 123 | const auto& it = _cache.find(key); |
| 124 | if (it == _cache.end()) { |
| 125 | return std::nullopt; |
| 126 | } |
| 127 | |
| 128 | return {it->value()}; |
| 129 | } |
| 130 | |
| 131 | void TextShaperCache::insert(const TextShaperCacheKey& key, const ShapedGlyph* glyphs, size_t glyphsLength) { |
| 132 | auto node = TextShaperCacheNode::make(key.fontId, |