[core] Custom layers
This commit is contained in:
18
test/fixtures/util.cpp
vendored
18
test/fixtures/util.cpp
vendored
@@ -1,5 +1,6 @@
|
||||
#include "util.hpp"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/util/io.hpp>
|
||||
@@ -12,12 +13,21 @@
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <csignal>
|
||||
#include <future>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
namespace mbgl {
|
||||
namespace test {
|
||||
|
||||
std::string getFileSourceRoot() {
|
||||
#ifdef MBGL_ASSET_ZIP
|
||||
return "test/fixtures/annotations/assets.zip";
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
pid_t startServer(const char *executable) {
|
||||
int pipefd[2];
|
||||
|
||||
@@ -85,6 +95,14 @@ uint64_t crc64(const std::string& str) {
|
||||
return crc64(str.data(), str.size());
|
||||
}
|
||||
|
||||
PremultipliedImage render(Map& map) {
|
||||
std::promise<PremultipliedImage> promise;
|
||||
map.renderStill([&](std::exception_ptr, PremultipliedImage&& image) {
|
||||
promise.set_value(std::move(image));
|
||||
});
|
||||
return promise.get_future().get();
|
||||
}
|
||||
|
||||
void checkImage(const std::string& base,
|
||||
const PremultipliedImage& actual,
|
||||
double imageThreshold,
|
||||
|
||||
Reference in New Issue
Block a user