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

More GlyphAtlas refactoring - #8747

Merged
jfirebaugh merged 2 commits into
masterfrom
glyph-atlas
Apr 14, 2017
Merged

jfirebaugh merged 2 commits into
masterfrom
glyph-atlas

Conversation

@jfirebaugh

Copy link
Copy Markdown
Contributor
  • Replace GlyphRangeSet in onGlyphsAvailable with optionals in the map. GlyphRangeSet isn't keyed by FontStack, so using it to indicate that a particular range was loaded could have produced false positives.
  • Combine the two GlyphID-keyed maps in GlyphAtlas::Entry into one.

@ChrisLoer ChrisLoer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, good catch on the potential false positives for glyph range collisions. The changes look great. 👍


for (const auto& glyphID : glyphIDs) {
loadedRanges.insert(getGlyphRange(glyphID));
optional<Glyph>& glyph = positions[glyphID];

@ChrisLoer ChrisLoer Apr 14, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is really important to the logic in the tile worker, and its effect is a little bit subtle. Maybe put a comment like:

// Make a glyph position entry even if we didn't get an SDF for the glyph
// This distinguishes between "not loaded yet" and "loaded but nothing to show"

…he map

GlyphRangeSet isn't keyed by FontStack, so using it to indicate that a particular range was loaded could have produced false positives.
@jfirebaugh
jfirebaugh merged commit fcf5d1b into master Apr 14, 2017
@jfirebaugh
jfirebaugh deleted the glyph-atlas branch April 14, 2017 22:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants