summaryrefslogtreecommitdiff
path: root/test/api/api_misuse.test.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-10-10 17:16:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-10-25 13:52:36 -0700
commita4d259c33f9bb890bba97fd89552720e3e0ec09b (patch)
tree342ecc27a6993c48f3a2e1d739fce890350bc44d /test/api/api_misuse.test.cpp
parent5cc390d694fc7510d445310d8eb9e32429a5e67b (diff)
downloadqtlocation-mapboxgl-a4d259c33f9bb890bba97fd89552720e3e0ec09b.tar.gz
[core] move gl::Context to Backend and refactor View
Diffstat (limited to 'test/api/api_misuse.test.cpp')
-rw-r--r--test/api/api_misuse.test.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp
index f11363fa3c..eb271b0258 100644
--- a/test/api/api_misuse.test.cpp
+++ b/test/api/api_misuse.test.cpp
@@ -4,7 +4,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/storage/online_file_source.hpp>
#include <mbgl/platform/default/thread_pool.hpp>
#include <mbgl/util/exception.hpp>
@@ -21,14 +21,13 @@ TEST(API, RenderWithoutCallback) {
util::RunLoop loop;
HeadlessBackend backend;
- HeadlessView view;
- view.resize(128, 512);
+ OffscreenView view(backend.getContext(), {{ 128, 512 }});
StubFileSource fileSource;
ThreadPool threadPool(4);
- std::unique_ptr<Map> map = std::make_unique<Map>(backend, view, view.getPixelRatio(),
- fileSource, threadPool, MapMode::Still);
- map->renderStill(nullptr);
+ std::unique_ptr<Map> map =
+ std::make_unique<Map>(backend, view.getSize(), 1, fileSource, threadPool, MapMode::Still);
+ map->renderStill(view, nullptr);
// Force Map thread to join.
map.reset();
@@ -47,15 +46,14 @@ TEST(API, RenderWithoutStyle) {
util::RunLoop loop;
HeadlessBackend backend;
- HeadlessView view;
- view.resize(128, 512);
+ OffscreenView view(backend.getContext(), {{ 128, 512 }});
StubFileSource fileSource;
ThreadPool threadPool(4);
- Map map(backend, view, view.getPixelRatio(), fileSource, threadPool, MapMode::Still);
+ Map map(backend, view.getSize(), 1, fileSource, threadPool, MapMode::Still);
std::exception_ptr error;
- map.renderStill([&](std::exception_ptr error_, PremultipliedImage&&) {
+ map.renderStill(view, [&](std::exception_ptr error_) {
error = error_;
loop.stop();
});