[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

@@ -18,8 +18,6 @@ RasterTileData::RasterTileData(const OverscaledTileID& id_,
: TileData(id_),
texturePool(texturePool_),
worker(worker_) {
state = State::loading;
const Resource resource =
Resource::tile(urlTemplate, pixelRatio, id.canonical.x, id.canonical.y, id.canonical.z);
req = fileSource.request(resource, [callback, this](Response res) {
@@ -39,17 +37,9 @@ RasterTileData::RasterTileData(const OverscaledTileID& id_,
modified = res.modified;
expires = res.expires;
// Only overwrite the state when we didn't have a previous tile.
if (state == State::loading) {
state = State::loaded;
}
workRequest.reset();
workRequest = worker.parseRasterTile(std::make_unique<RasterBucket>(texturePool), res.data, [this, callback] (RasterTileParseResult result) {
workRequest.reset();
if (state != State::loaded) {
return;
}
std::exception_ptr error;
if (result.is<std::unique_ptr<Bucket>>()) {