Report errors when parsing raster tiles

Use the same API/pattern for parsing raster tiles as we use for vector
tiles. Forward the error as an exception that will ultimately reach the
StillImageCallback.

Also set the tile to State::obsolete on error like we do for vector
tiles.
This commit is contained in:
Thiago Marcos P. Santos
2015-07-02 16:04:30 +03:00
parent c357ce540a
commit 9cc986e758
8 changed files with 26 additions and 18 deletions

View File

@@ -23,8 +23,8 @@ void RasterBucket::render(Painter& painter,
painter.renderRaster(*this, layer_desc, id, matrix);
}
bool RasterBucket::setImage(const std::string &data) {
return raster.load(data);
bool RasterBucket::setImage(std::unique_ptr<util::Image> image) {
return raster.load(std::move(image));
}
void RasterBucket::drawRaster(RasterShader& shader, StaticVertexBuffer &vertices, VertexArrayObject &array) {

View File

@@ -20,7 +20,7 @@ public:
void render(Painter&, const StyleLayer&, const TileID&, const mat4&) override;
bool hasData() const;
bool setImage(const std::string &data);
bool setImage(std::unique_ptr<util::Image> image);
const StyleLayoutRaster &layout;