diff options
Diffstat (limited to 'bin/render.cpp')
-rw-r--r-- | bin/render.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/render.cpp b/bin/render.cpp index 74fd6fdcc4..fedd8bbda6 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -8,6 +8,8 @@ #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/style/style.hpp> +#include <mbgl/renderer/renderer.hpp> +#include <mbgl/renderer/async_renderer_frontend.hpp> #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-pragmas" @@ -88,7 +90,8 @@ int main(int argc, char *argv[]) { OffscreenView view(backend.getContext(), { static_cast<uint32_t>(width * pixelRatio), static_cast<uint32_t>(height * pixelRatio) }); ThreadPool threadPool(4); - Map map(backend, MapObserver::nullObserver(), mbgl::Size { width, height }, pixelRatio, fileSource, threadPool, MapMode::Still); + AsyncRendererFrontend rendererFrontend(std::make_unique<Renderer>(backend, pixelRatio, fileSource, threadPool), view); + Map map(rendererFrontend, MapObserver::nullObserver(), mbgl::Size { width, height }, pixelRatio, fileSource, threadPool, MapMode::Still); if (style_path.find("://") == std::string::npos) { style_path = std::string("file://") + style_path; @@ -103,7 +106,7 @@ int main(int argc, char *argv[]) { map.setDebug(debug ? mbgl::MapDebugOptions::TileBorders | mbgl::MapDebugOptions::ParseStatus : mbgl::MapDebugOptions::NoDebug); } - map.renderStill(view, [&](std::exception_ptr error) { + map.renderStill([&](std::exception_ptr error) { try { if (error) { std::rethrow_exception(error); |