move to raster buckets & tile parser handling raster decoding

This commit is contained in:
Justin R. Miller
2014-04-09 11:38:42 -07:00
parent 482ac31fde
commit e5713f31a6
9 changed files with 95 additions and 40 deletions

View File

@@ -70,19 +70,11 @@ bool TileData::parse() {
return false;
}
if (is_raster) {
// raster tiles don't need parsed, just decoded
raster = std::make_shared<Raster>();
raster->load(data);
state = State::parsed;
return true;
}
try {
// Parsing creates state that is encapsulated in TileParser. While parsing,
// the TileParser object writes results into this objects. All other state
// is going to be discarded afterwards.
TileParser parser(data, *this, style, glyphAtlas);
TileParser parser(data, *this, style, glyphAtlas, is_raster);
} catch (const std::exception& ex) {
fprintf(stderr, "[%p] exception [%d/%d/%d]... failed: %s\n", this, id.z, id.x, id.y, ex.what());
cancel();