Files
MapLibreParticleLab/src/mbgl/map/vector_tile_data.hpp
Thiago Marcos P. Santos c6e58515fc Keep updating until all the tiles are State::parsed
This is needed because of a race that can occur now that we
requests Glyphs from the Map Thread:

The glyph might arrive at the moment a tile is being parsed
and they won't be notified again of any new data, remaining
forever at the partial state.
2015-07-16 19:38:38 +03:00

54 lines
1.1 KiB
C++

#ifndef MBGL_MAP_VECTOR_TILE_DATA
#define MBGL_MAP_VECTOR_TILE_DATA
#include <mbgl/map/tile_data.hpp>
#include <mbgl/map/tile_worker.hpp>
#include <atomic>
namespace mbgl {
class Style;
class SourceInfo;
class WorkRequest;
class Request;
class VectorTileData : public TileData {
public:
VectorTileData(const TileID&,
Style&,
const SourceInfo&,
float angle_,
bool collisionDebug_);
~VectorTileData();
Bucket* getBucket(const StyleLayer&) override;
void request(float pixelRatio,
const std::function<void()>& callback);
bool reparse(std::function<void ()> callback);
void redoPlacement(float angle, bool collisionDebug) override;
void cancel() override;
private:
Worker& worker;
TileWorker tileWorker;
std::unique_ptr<WorkRequest> workRequest;
bool parsing = false;
const SourceInfo& source;
Request* req = nullptr;
std::string data;
float lastAngle = 0;
float currentAngle;
bool lastCollisionDebug = 0;
bool currentCollisionDebug = 0;
bool redoingPlacement = false;
};
}
#endif