Files
MapLibreParticleLab/src/mbgl/map/raster_tile_data.cpp
Thiago Marcos P. Santos aa9adbb8f8 Scope the Tile worker thread to an Environment
We are also removing the code that is passing the Environment around
and instead, we get now the Environment in the TileData using
Environment::Get().

When processing the job, the work will be temporally registered to
the Environment as "TileWorker_0/0/0" which can be used for logging
in the future. At the end of the job, it gets unregistered
automatically from the Environment.
2015-03-18 12:51:33 +01:00

34 lines
824 B
C++

#include <mbgl/map/map.hpp>
#include <mbgl/map/raster_tile_data.hpp>
#include <mbgl/style/style.hpp>
using namespace mbgl;
RasterTileData::RasterTileData(Tile::ID const &id_, TexturePool &texturePool,
const SourceInfo &source_)
: TileData(id_, source_), bucket(texturePool, layout) {
}
RasterTileData::~RasterTileData() {
}
void RasterTileData::parse() {
if (state != State::loaded) {
return;
}
if (bucket.setImage(data)) {
state = State::parsed;
} else {
state = State::invalid;
}
}
void RasterTileData::render(Painter &painter, const StyleLayer &layer_desc, const mat4 &matrix) {
bucket.render(painter, layer_desc, id, matrix);
}
bool RasterTileData::hasData(StyleLayer const& /*layer_desc*/) const {
return bucket.hasData();
}