diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-06-13 10:50:16 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-07-18 10:45:12 +0200 |
commit | 3832f8d0d8194b81ea34a045e19b0d5bc7a89e25 (patch) | |
tree | bbb4b277e1e74bde457271b9b9a5b6a9ec3ad5fb /bin/render.cpp | |
parent | 39a732d7ae3cb1b927d94c4b1154b42d9565356a (diff) | |
download | qtlocation-mapboxgl-3832f8d0d8194b81ea34a045e19b0d5bc7a89e25.tar.gz |
[core] renderer interface
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); |