#include #include #include #include #include namespace mbgl { RasterTileWorker::RasterTileWorker(ActorRef, ActorRef parent_) : parent(std::move(parent_)) { } void RasterTileWorker::parse(std::shared_ptr data) { if (!data) { parent.invoke(&RasterTile::onParsed, nullptr); // No data; empty tile. return; } try { auto bucket = std::make_unique(util::unpremultiply(decodeImage(*data))); parent.invoke(&RasterTile::onParsed, std::move(bucket)); } catch (...) { parent.invoke(&RasterTile::onError, std::current_exception()); } } } // namespace mbgl