diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-10-06 13:23:50 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-10-25 13:52:36 -0700 |
commit | 5cc390d694fc7510d445310d8eb9e32429a5e67b (patch) | |
tree | 7a24706f919ac3e8154be8b4ce33aed5bf42188d /test/api/api_misuse.test.cpp | |
parent | 45f4dc0166f2d609d014d2174209fdbe1994c943 (diff) | |
download | qtlocation-mapboxgl-5cc390d694fc7510d445310d8eb9e32429a5e67b.tar.gz |
[core] separate Backend from View for headless rendering
Diffstat (limited to 'test/api/api_misuse.test.cpp')
-rw-r--r-- | test/api/api_misuse.test.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp index 2016e278da..f11363fa3c 100644 --- a/test/api/api_misuse.test.cpp +++ b/test/api/api_misuse.test.cpp @@ -3,7 +3,8 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/map/map.hpp> -#include <mbgl/platform/default/headless_display.hpp> +#include <mbgl/platform/default/headless_backend.hpp> +#include <mbgl/platform/default/headless_view.hpp> #include <mbgl/storage/online_file_source.hpp> #include <mbgl/platform/default/thread_pool.hpp> #include <mbgl/util/exception.hpp> @@ -19,13 +20,14 @@ TEST(API, RenderWithoutCallback) { util::RunLoop loop; - auto display = std::make_shared<mbgl::HeadlessDisplay>(); - HeadlessView view(display, 1); + HeadlessBackend backend; + HeadlessView view; view.resize(128, 512); StubFileSource fileSource; ThreadPool threadPool(4); - std::unique_ptr<Map> map = std::make_unique<Map>(view, fileSource, threadPool, MapMode::Still); + std::unique_ptr<Map> map = std::make_unique<Map>(backend, view, view.getPixelRatio(), + fileSource, threadPool, MapMode::Still); map->renderStill(nullptr); // Force Map thread to join. @@ -44,13 +46,13 @@ TEST(API, RenderWithoutCallback) { TEST(API, RenderWithoutStyle) { util::RunLoop loop; - auto display = std::make_shared<mbgl::HeadlessDisplay>(); - HeadlessView view(display, 1); + HeadlessBackend backend; + HeadlessView view; view.resize(128, 512); StubFileSource fileSource; ThreadPool threadPool(4); - Map map(view, fileSource, threadPool, MapMode::Still); + Map map(backend, view, view.getPixelRatio(), fileSource, threadPool, MapMode::Still); std::exception_ptr error; map.renderStill([&](std::exception_ptr error_, PremultipliedImage&&) { |