diff options
Diffstat (limited to 'test/api/repeated_render.test.cpp')
-rw-r--r-- | test/api/repeated_render.test.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp index 5bc57198bd..715b49b289 100644 --- a/test/api/repeated_render.test.cpp +++ b/test/api/repeated_render.test.cpp @@ -3,7 +3,7 @@ #include <mbgl/map/map.hpp> #include <mbgl/platform/default/headless_backend.hpp> -#include <mbgl/platform/default/headless_view.hpp> +#include <mbgl/platform/default/offscreen_view.hpp> #include <mbgl/platform/default/thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/util/image.hpp> @@ -20,7 +20,7 @@ TEST(API, RepeatedRender) { const auto style = util::read_file("test/fixtures/api/water.json"); HeadlessBackend backend; - HeadlessView view(1, 256, 512); + OffscreenView view(backend.getContext(), {{ 256, 512 }}); #ifdef MBGL_ASSET_ZIP // Regenerate with `cd test/fixtures/api/ && zip -r assets.zip assets/` DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets.zip"); @@ -32,13 +32,13 @@ TEST(API, RepeatedRender) { Log::setObserver(std::make_unique<FixtureLogObserver>()); - Map map(backend, view, view.getPixelRatio(), fileSource, threadPool, MapMode::Still); + Map map(backend, view.getSize(), 1, fileSource, threadPool, MapMode::Still); { map.setStyleJSON(style); PremultipliedImage result; - map.renderStill([&result](std::exception_ptr, PremultipliedImage&& image) { - result = std::move(image); + map.renderStill(view, [&](std::exception_ptr) { + result = view.readStillImage(); }); while (!result.size()) { @@ -55,8 +55,8 @@ TEST(API, RepeatedRender) { { map.setStyleJSON(style); PremultipliedImage result; - map.renderStill([&result](std::exception_ptr, PremultipliedImage&& image) { - result = std::move(image); + map.renderStill(view, [&](std::exception_ptr) { + result = view.readStillImage(); }); while (!result.size()) { |