summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-06-25 13:58:34 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-06-26 10:32:07 -0700
commit07a6d2ef647e44151c269de2abdc98c89b0ae910 (patch)
tree82f423c9bafa82299d097447ff9a4785437d409b /test
parente87a36444f5210b50331fa8f456be110534dec81 (diff)
downloadqtlocation-mapboxgl-07a6d2ef647e44151c269de2abdc98c89b0ae910.tar.gz
Move Transform from MapData to Map
Pass current state to MapContext where needed. Remove mutex from Transform.
Diffstat (limited to 'test')
-rw-r--r--test/miscellaneous/map_context.cpp2
-rw-r--r--test/miscellaneous/transform.cpp9
-rw-r--r--test/style/resource_loading.cpp16
3 files changed, 10 insertions, 17 deletions
diff --git a/test/miscellaneous/map_context.cpp b/test/miscellaneous/map_context.cpp
index 6e9ed85c3f..f1f26a9c47 100644
--- a/test/miscellaneous/map_context.cpp
+++ b/test/miscellaneous/map_context.cpp
@@ -13,7 +13,7 @@ TEST(MapContext, DoubleStyleLoad) {
std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>();
HeadlessView view(display, 512, 512, 1);
DefaultFileSource fileSource(nullptr);
- MapData data(view, MapMode::Continuous);
+ MapData data(MapMode::Continuous);
util::Thread<MapContext> context({"Map", util::ThreadType::Map, util::ThreadPriority::Regular}, view, fileSource, data);
diff --git a/test/miscellaneous/transform.cpp b/test/miscellaneous/transform.cpp
index 3c25c27057..5d00bfd20b 100644
--- a/test/miscellaneous/transform.cpp
+++ b/test/miscellaneous/transform.cpp
@@ -1,14 +1,7 @@
#include "../fixtures/util.hpp"
#include "../fixtures/mock_view.hpp"
-#include <mbgl/util/run_loop.hpp>
-#include <mbgl/map/map_data.hpp>
-#include <mbgl/map/map_context.hpp>
-#include <mbgl/platform/default/headless_view.hpp>
-#include <mbgl/platform/default/headless_display.hpp>
-#include <mbgl/storage/default_file_source.hpp>
-
-#include <cstdlib>
+#include <mbgl/map/transform.hpp>
using namespace mbgl;
diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp
index 82784f673c..36137f1adc 100644
--- a/test/style/resource_loading.cpp
+++ b/test/style/resource_loading.cpp
@@ -4,7 +4,7 @@
#include "mock_file_source.hpp"
#include <mbgl/map/map_data.hpp>
-#include <mbgl/map/transform_state.hpp>
+#include <mbgl/map/transform.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/io.hpp>
@@ -24,12 +24,13 @@ public:
View& view,
FileSource& fileSource,
const std::function<void(std::exception_ptr error)>& callback)
- : data_(view, MapMode::Still),
+ : data_(MapMode::Still),
+ transform_(view),
callback_(callback) {
util::ThreadContext::setFileSource(&fileSource);
- data_.transform.resize(1000, 1000, 1.0, 1000, 1000);
- data_.transform.setLatLngZoom({0, 0}, 16);
+ transform_.resize(1000, 1000, 1.0, 1000, 1000);
+ transform_.setLatLngZoom({0, 0}, 16);
const std::string style = util::read_file("test/fixtures/resources/style.json");
style_ = std::make_unique<Style>(style, "", loop),
@@ -44,10 +45,9 @@ public:
const auto now = Clock::now();
data_.setAnimationTime(now);
- data_.transform.updateTransitions(now);
+ transform_.updateTransitions(now);
- transformState_ = data_.transform.currentState();
- style_->update(data_, transformState_, texturePool_);
+ style_->update(data_, transform_.currentState(), texturePool_);
}
// Style::Observer implementation.
@@ -65,7 +65,7 @@ public:
private:
MapData data_;
- TransformState transformState_;
+ Transform transform_;
TexturePool texturePool_;
std::unique_ptr<Style> style_;