diff options
Diffstat (limited to 'test/api/repeated_render.test.cpp')
-rw-r--r-- | test/api/repeated_render.test.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp index 715b49b289..49b9a31b0b 100644 --- a/test/api/repeated_render.test.cpp +++ b/test/api/repeated_render.test.cpp @@ -2,9 +2,9 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/map/map.hpp> -#include <mbgl/platform/default/headless_backend.hpp> -#include <mbgl/platform/default/offscreen_view.hpp> -#include <mbgl/platform/default/thread_pool.hpp> +#include <mbgl/gl/headless_backend.hpp> +#include <mbgl/gl/offscreen_view.hpp> +#include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/util/image.hpp> #include <mbgl/util/io.hpp> @@ -12,15 +12,17 @@ #include <future> +using namespace mbgl; + + TEST(API, RepeatedRender) { - using namespace mbgl; util::RunLoop loop; const auto style = util::read_file("test/fixtures/api/water.json"); - HeadlessBackend backend; - OffscreenView view(backend.getContext(), {{ 256, 512 }}); + HeadlessBackend backend { test::sharedDisplay() }; + 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,7 +34,7 @@ TEST(API, RepeatedRender) { Log::setObserver(std::make_unique<FixtureLogObserver>()); - Map map(backend, view.getSize(), 1, fileSource, threadPool, MapMode::Still); + Map map(backend, view.size, 1, fileSource, threadPool, MapMode::Still); { map.setStyleJSON(style); @@ -41,12 +43,12 @@ TEST(API, RepeatedRender) { result = view.readStillImage(); }); - while (!result.size()) { + while (!result.valid()) { loop.runOnce(); } - ASSERT_EQ(256u, result.width); - ASSERT_EQ(512u, result.height); + ASSERT_EQ(256u, result.size.width); + ASSERT_EQ(512u, result.size.height); #if !TEST_READ_ONLY util::write_file("test/fixtures/api/1.png", encodePNG(result)); #endif @@ -59,12 +61,12 @@ TEST(API, RepeatedRender) { result = view.readStillImage(); }); - while (!result.size()) { + while (!result.valid()) { loop.runOnce(); } - ASSERT_EQ(256u, result.width); - ASSERT_EQ(512u, result.height); + ASSERT_EQ(256u, result.size.width); + ASSERT_EQ(512u, result.size.height); #if !TEST_READ_ONLY util::write_file("test/fixtures/api/2.png", encodePNG(result)); #endif |