summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile_worker.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-06-01 10:30:49 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-13 10:18:43 -0700
commit92252849c1a2ddf7887d1908841fa3c90dd59766 (patch)
tree9d192d0e60b46479122ea2e4a606b598287d49d7 /src/mbgl/tile/geometry_tile_worker.cpp
parentb201a7900f989af432aaea500a0e6c5ea5bbba53 (diff)
downloadqtlocation-mapboxgl-92252849c1a2ddf7887d1908841fa3c90dd59766.tar.gz
[core] Per-bucket glyph atlases
Diffstat (limited to 'src/mbgl/tile/geometry_tile_worker.cpp')
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index 3fd6bb47f0..8eaea161d2 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -197,37 +197,37 @@ void GeometryTileWorker::coalesce() {
self.invoke(&GeometryTileWorker::coalesced);
}
-void GeometryTileWorker::onGlyphsAvailable(GlyphPositionMap newGlyphPositions) {
- for (auto& newFontGlyphs : newGlyphPositions) {
+void GeometryTileWorker::onGlyphsAvailable(GlyphMap newGlyphMap) {
+ for (auto& newFontGlyphs : newGlyphMap) {
const FontStack& fontStack = newFontGlyphs.first;
- GlyphPositions& newPositions = newFontGlyphs.second;
+ Glyphs& newGlyphs = newFontGlyphs.second;
- GlyphPositions& positions = glyphPositions[fontStack];
+ Glyphs& glyphs = glyphMap[fontStack];
GlyphIDs& pendingGlyphIDs = pendingGlyphDependencies[fontStack];
- for (auto& newPosition : newPositions) {
- const GlyphID& glyphID = newPosition.first;
- optional<Glyph>& glyph = newPosition.second;
+ for (auto& newGlyph : newGlyphs) {
+ const GlyphID& glyphID = newGlyph.first;
+ optional<Immutable<Glyph>>& glyph = newGlyph.second;
if (pendingGlyphIDs.erase(glyphID)) {
- positions.emplace(glyphID, std::move(glyph));
+ glyphs.emplace(glyphID, std::move(glyph));
}
}
}
symbolDependenciesChanged();
}
-void GeometryTileWorker::onIconsAvailable(IconMap newIcons) {
- icons = std::move(newIcons);
+void GeometryTileWorker::onIconsAvailable(IconMap newIconMap) {
+ iconMap = std::move(newIconMap);
pendingIconDependencies.clear();
symbolDependenciesChanged();
}
void GeometryTileWorker::requestNewGlyphs(const GlyphDependencies& glyphDependencies) {
for (auto& fontDependencies : glyphDependencies) {
- auto fontGlyphs = glyphPositions.find(fontDependencies.first);
+ auto fontGlyphs = glyphMap.find(fontDependencies.first);
for (auto glyphID : fontDependencies.second) {
- if (fontGlyphs == glyphPositions.end() || fontGlyphs->second.find(glyphID) == fontGlyphs->second.end()) {
+ if (fontGlyphs == glyphMap.end() || fontGlyphs->second.find(glyphID) == fontGlyphs->second.end()) {
pendingGlyphDependencies[fontDependencies.first].insert(glyphID);
}
}
@@ -393,7 +393,7 @@ void GeometryTileWorker::attemptPlacement() {
}
if (symbolLayout->state == SymbolLayout::Pending) {
- symbolLayout->prepare(glyphPositions, icons);
+ symbolLayout->prepare(glyphMap, iconMap);
symbolLayout->state = SymbolLayout::Placed;
}