Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add eviction strategy for Glyphs #12388

@kkaefer

Description

@kkaefer

In #9213, we factored out glyph management from the GlyphAtlas into its own class called GlyphManager. Previously, glyphs were stored and associated with a style, which meant that setting a new style also removed all cached glyphs. This isn't true anymore after #9213, since the GlyphManager is now owned by the Renderer::Impl, which persists across styles changes.

GlyphManager only ever has Glyphs/PBFs added to it, never removed, including glyphs from previously loaded styles that aren't used anymore. We should add an eviction strategy for glyphs that are unused so that they don't stick around forever in long-lived Map objects.

@jfirebaugh thinks that this could be fairly straightforward: promote style::Parser::fontStacks to a more general location, and then in Renderer::Impl::render, remove any unused font stacks from GlyphManager when the layer diff is non-empty.

Metadata

Metadata

Assignees

Labels

CoreThe cross-platform C++ core, aka mbglrefactor

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions