[core] remove TileData::State::loaded

This commit is contained in:
Konstantin Käfer
2016-05-25 19:54:30 +02:00
parent 95dc8ff3e1
commit c52a0c65f4
5 changed files with 11 additions and 28 deletions

View File

@@ -29,7 +29,6 @@ VectorTileData::VectorTileData(const OverscaledTileID& id_,
mode_),
monitor(std::move(monitor_))
{
state = State::loading;
tileRequest = monitor->monitorTile([callback, this](std::exception_ptr err,
std::unique_ptr<GeometryTile> tile,
optional<Timestamp> modified_,
@@ -51,9 +50,9 @@ VectorTileData::VectorTileData(const OverscaledTileID& id_,
return;
}
if (state == State::loading) {
state = State::loaded;
} else if (isRenderable()) {
// Mark the tile as pending again if it was complete before to prevent signaling a complete
// state despite pending parse operations.
if (isComplete()) {
state = State::partial;
}
@@ -80,7 +79,7 @@ VectorTileData::VectorTileData(const OverscaledTileID& id_,
// existing buckets in case we got a refresh parse.
buckets = std::move(resultBuckets.buckets);
if (state == State::parsed) {
if (isComplete()) {
featureIndex = std::move(resultBuckets.featureIndex);
geometryTile = std::move(resultBuckets.geometryTile);
}
@@ -127,7 +126,7 @@ bool VectorTileData::parsePending(std::function<void(std::exception_ptr)> callba
// place again in case the configuration has changed.
placedConfig = config;
if (state == State::parsed) {
if (isComplete()) {
featureIndex = std::move(resultBuckets.featureIndex);
geometryTile = std::move(resultBuckets.geometryTile);
}