[core] reparse tiles when new data arrives
We're now reparsing tiles when they expire. We're also swapping out buckets atomically to avoid flickering data; i.e. we're displaying the old data as long as we don't have a new parsed bucket for that layer yet. The parsed buckets now live in the *TileData objects rather than in the TileWorker; only partially parsed == pending buckets will remain in the TileWorker. Once they're parsed, they're moved to the *TileData object.
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
#include <mbgl/map/tile_data.hpp>
|
||||
#include <mbgl/renderer/debug_bucket.hpp>
|
||||
|
||||
using namespace mbgl;
|
||||
namespace mbgl {
|
||||
|
||||
TileData::TileData(const TileID& id_)
|
||||
: id(id_),
|
||||
debugBucket(debugFontBuffer),
|
||||
state(State::initial) {
|
||||
// Initialize tile debug coordinates
|
||||
debugFontBuffer.addText(std::string(id).c_str(), 50, 200, 5);
|
||||
}
|
||||
|
||||
TileData::~TileData() = default;
|
||||
|
||||
const char* TileData::StateToString(const State state) {
|
||||
switch (state) {
|
||||
case TileData::State::initial: return "initial";
|
||||
case TileData::State::invalid : return "invalid";
|
||||
case TileData::State::loading : return "loading";
|
||||
case TileData::State::loaded : return "loaded";
|
||||
case TileData::State::obsolete : return "obsolete";
|
||||
case TileData::State::parsed : return "parsed";
|
||||
case TileData::State::partial : return "partial";
|
||||
default: return "<unknown>";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user