summaryrefslogtreecommitdiff
path: root/test/style
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-07-01 12:39:21 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-07-08 10:40:05 +0200
commit675ddddee78fa36d60d55c266033f05edda4be48 (patch)
treee7e09473400600070778b620d1cd1eb0a78d7b7d /test/style
parent3a07cb2f1edb4e8f5e076ec0fef32f733676a95c (diff)
downloadqtlocation-mapboxgl-675ddddee78fa36d60d55c266033f05edda4be48.tar.gz
Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
Diffstat (limited to 'test/style')
-rw-r--r--test/style/pending_resources.cpp3
-rw-r--r--test/style/resource_loading.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/test/style/pending_resources.cpp b/test/style/pending_resources.cpp
index 4614c187b7..8eea81191d 100644
--- a/test/style/pending_resources.cpp
+++ b/test/style/pending_resources.cpp
@@ -29,7 +29,7 @@ TEST_P(PendingResources, DeleteMapObjectWithPendingRequest) {
util::RunLoop loop(uv_default_loop());
auto display = std::make_shared<mbgl::HeadlessDisplay>();
- HeadlessView view(display);
+ HeadlessView view(display, 1, 1000, 1000);
MockFileSource fileSource(MockFileSource::SuccessWithDelay, GetParam());
std::unique_ptr<Map> map = std::make_unique<Map>(view, fileSource, MapMode::Still);
@@ -43,7 +43,6 @@ TEST_P(PendingResources, DeleteMapObjectWithPendingRequest) {
fileSource.setOnRequestDelayedCallback([&endTest] { endTest.send(); });
const std::string style = util::read_file("test/fixtures/resources/style.json");
- map->resize(1000, 1000, 1.0);
map->setStyleJSON(style, ".");
map->renderStill([&endTest](std::exception_ptr, std::unique_ptr<const StillImage>) {
diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp
index fc8905f7bb..071df09338 100644
--- a/test/style/resource_loading.cpp
+++ b/test/style/resource_loading.cpp
@@ -23,12 +23,12 @@ public:
MockMapContext(View& view,
FileSource& fileSource,
const std::function<void(std::exception_ptr error)>& callback)
- : data_(MapMode::Still),
+ : data_(MapMode::Still, view.getPixelRatio()),
transform_(view),
callback_(callback) {
util::ThreadContext::setFileSource(&fileSource);
- transform_.resize(1000, 1000, 1.0, 1000, 1000);
+ transform_.resize({{ 1000, 1000 }});
transform_.setLatLngZoom({0, 0}, 16);
const std::string style = util::read_file("test/fixtures/resources/style.json");