blob: 4cd7fc2b5e8a78e8a0508f762f129fb66a89b565 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#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_, Environment &env_)
: TileData(id_, source_, env_), 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();
}
|