diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-08-30 18:45:24 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-09-02 23:18:29 +0300 |
commit | 227776dee04d440c0b6082def2bf5e40da65ecbc (patch) | |
tree | 2e42afae188af801c2df92ebfc052a700b35e2d7 | |
parent | 322e1aa2c3c2570554a2fe2bbfa733ab7bbd4e81 (diff) | |
download | qtlocation-mapboxgl-227776dee04d440c0b6082def2bf5e40da65ecbc.tar.gz |
Style no longer requires mainloop access
-rw-r--r-- | src/mbgl/map/map_context.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/style/style.hpp | 4 | ||||
-rw-r--r-- | test/style/resource_loading.cpp | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 17d3a87ccc..c36b4fc9d6 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -104,7 +104,7 @@ void MapContext::setStyleURL(const std::string& url) { styleURL = url; styleJSON.clear(); - style = std::make_unique<Style>(data, asyncUpdate->get()->loop); + style = std::make_unique<Style>(data); const size_t pos = styleURL.rfind('/'); std::string base = ""; @@ -127,7 +127,7 @@ void MapContext::setStyleJSON(const std::string& json, const std::string& base) styleURL.clear(); styleJSON = json; - style = std::make_unique<Style>(data, asyncUpdate->get()->loop); + style = std::make_unique<Style>(data); loadStyleJSON(json, base); } diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 5f92bb2664..7686215301 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -12,7 +12,6 @@ #include <mbgl/geometry/sprite_atlas.hpp> #include <mbgl/geometry/line_atlas.hpp> #include <mbgl/util/constants.hpp> -#include <mbgl/util/uv_detail.hpp> #include <mbgl/platform/log.hpp> #include <csscolorparser/csscolorparser.hpp> @@ -22,7 +21,7 @@ namespace mbgl { -Style::Style(MapData& data_, uv_loop_t*) +Style::Style(MapData& data_) : data(data_), glyphStore(std::make_unique<GlyphStore>()), glyphAtlas(std::make_unique<GlyphAtlas>(1024, 1024)), diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 6d8a7ae522..cbc0ee2db2 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -8,7 +8,6 @@ #include <mbgl/map/sprite.hpp> #include <mbgl/text/glyph_store.hpp> -#include <mbgl/util/uv.hpp> #include <mbgl/util/ptr.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/chrono.hpp> @@ -32,8 +31,7 @@ class Style : public GlyphStore::Observer, public Sprite::Observer, public util::noncopyable { public: - Style(MapData&, - uv_loop_t*); + Style(MapData&); ~Style(); class Observer { diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp index b4fdbc7c5a..0562434586 100644 --- a/test/style/resource_loading.cpp +++ b/test/style/resource_loading.cpp @@ -32,7 +32,7 @@ public: transform_.setLatLngZoom({0, 0}, 16); const std::string style = util::read_file("test/fixtures/resources/style.json"); - style_ = std::make_unique<Style>(data_, util::RunLoop::getLoop()); + style_ = std::make_unique<Style>(data_); style_->setJSON(style, ""); style_->setObserver(this); } |