46 const std::shared_ptr<FilterContents>& contents,
48 auto it = entries_.find(text_key);
50 if (it != entries_.end()) {
51 it->second.used_this_frame =
true;
58 std::optional<Rect> filter_coverage = contents->
GetCoverage(entity);
59 if (!filter_coverage.has_value()) {
69 std::optional<Entity> maybe_entity =
70 contents->GetEntity(renderer, entity, contents->GetCoverageHint());
71 if (!maybe_entity.has_value()) {
89 TextShadowCacheData{.entity = maybe_entity.value().Clone(),
90 .used_this_frame =
true,
91 .key_matrix = key_matrix};
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
void MarkFrameStart()
Mark all glyph textures as unused this frame.
std::optional< Entity > Lookup(const ContentContext &renderer, const Entity &entity, const std::shared_ptr< FilterContents > &contents, const TextShadowCacheKey &)
Lookup the entity in the cache with the given filter/text contents, returning the new entity to rende...
void MarkFrameEnd()
Remove all glyph textures that were not referenced at least once.
A key to look up cached glyph textures.
TextShadowCacheKey(Scalar p_max_basis, int64_t p_identifier, bool p_is_single_glyph, const Font &p_font, Sigma p_sigma, Color p_color)