Style no longer requires mainloop access
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user