7 #include "fml/closure.h"
20 bool p_is_single_glyph,
23 : max_basis(p_max_basis),
24 identifier(p_identifier),
25 is_single_glyph(p_is_single_glyph),
31 for (
auto& entry : entries_) {
32 entry.second.used_this_frame =
false;
37 absl::erase_if(entries_,
38 [](
const auto& pair) {
return !pair.second.used_this_frame; });
44 const std::shared_ptr<FilterContents>& contents,
46 auto it = entries_.find(text_key);
48 if (it != entries_.end()) {
49 it->second.used_this_frame =
true;
56 std::optional<Rect> filter_coverage = contents->
GetCoverage(entity);
57 if (!filter_coverage.has_value()) {
65 fml::ScopedCleanupClosure closure(
67 std::optional<Entity> maybe_entity =
68 contents->GetEntity(renderer, entity, contents->GetCoverageHint());
69 if (!maybe_entity.has_value()) {
87 TextShadowCacheData{.entity = maybe_entity.value().Clone(),
88 .used_this_frame =
true,
89 .key_matrix = key_matrix};
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
void SetTransform(const Matrix &transform)
Set the global transform matrix for this Entity.
std::optional< Rect > GetCoverage() const
void SetClipDepth(uint32_t clip_depth)
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
uint32_t GetClipDepth() const
Describes a typeface along with any modifications to its intrinsic properties.
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.
static constexpr int32_t kMaxSigmaDenominator
A 4x4 matrix using column-major storage.
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
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)