[core] remove TileData::State::loaded
This commit is contained in:
@@ -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>>()) {
|
||||
|
||||
Reference in New Issue
Block a user