Files
MapLibreParticleLab/src/mbgl/tile/raster_tile.hpp
Konstantin Käfer 82bdd525a3 [core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
2017-09-21 12:21:18 +02:00

51 lines
1.2 KiB
C++

#pragma once
#include <mbgl/tile/tile.hpp>
#include <mbgl/tile/tile_loader.hpp>
#include <mbgl/tile/raster_tile_worker.hpp>
#include <mbgl/actor/actor.hpp>
namespace mbgl {
class Tileset;
class TileParameters;
namespace style {
class Layer;
} // namespace style
class RasterTile : public Tile {
public:
RasterTile(const OverscaledTileID&,
const TileParameters&,
const Tileset&);
~RasterTile() final;
void setNecessity(Necessity) final;
void setError(std::exception_ptr);
void setData(std::shared_ptr<const std::string> data,
optional<Timestamp> modified_,
optional<Timestamp> expires_);
void cancel() override;
Bucket* getBucket(const RenderLayer&) const override;
void onParsed(std::unique_ptr<Bucket> result, uint64_t correlationID);
void onError(std::exception_ptr, uint64_t correlationID);
private:
TileLoader<RasterTile> loader;
std::shared_ptr<Mailbox> mailbox;
Actor<RasterTileWorker> worker;
uint64_t correlationID = 0;
// Contains the Bucket object for the tile. Buckets are render
// objects and they get added by tile parsing operations.
std::unique_ptr<Bucket> bucket;
};
} // namespace mbgl