[core] place symbol layers in correct order

Previously, the placement of symbols depended on the order in which the
glyphs they need were loaded. The placement order should be based on the
style.

To fix this, symbol layers are placed in `placementPending` after they
are parsed. After all layers are parsed, symbol layers (stored in
`placementPending`) are placed and returned.
This commit is contained in:
Ansis Brammanis
2016-01-13 21:39:42 -08:00
parent 15f4ca51f9
commit e44db93f1c
9 changed files with 51 additions and 37 deletions

View File

@@ -39,9 +39,10 @@ public:
}
void parsePendingGeometryTileLayers(TileWorker* worker,
PlacementConfig config,
std::function<void(TileParseResult)> callback) {
try {
callback(worker->parsePendingLayers());
callback(worker->parsePendingLayers(config));
} catch (...) {
callback(std::current_exception());
}
@@ -87,10 +88,11 @@ Worker::parseGeometryTile(TileWorker& worker,
std::unique_ptr<WorkRequest>
Worker::parsePendingGeometryTileLayers(TileWorker& worker,
PlacementConfig config,
std::function<void(TileParseResult)> callback) {
current = (current + 1) % threads.size();
return threads[current]->invokeWithCallback(&Worker::Impl::parsePendingGeometryTileLayers,
callback, &worker);
callback, &worker, config);
}
std::unique_ptr<WorkRequest>