summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/style.hpp')
-rw-r--r--src/mbgl/style/style.hpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp
index 4de827a38c..04979b3377 100644
--- a/src/mbgl/style/style.hpp
+++ b/src/mbgl/style/style.hpp
@@ -15,23 +15,39 @@
#include <vector>
#include <set>
#include <chrono>
+#include <memory>
namespace mbgl {
+class Map;
+class Environment;
+class GlyphAtlas;
+class GlyphStore;
+class SpriteAtlas;
class Sprite;
+class LineAtlas;
class StyleLayer;
class StyleLayerGroup;
+class TexturePool;
-class Style : public util::noncopyable {
+class Style : public util::noncopyable,
+ public std::enable_shared_from_this<Style> {
public:
struct exception : std::runtime_error { exception(const char *msg) : std::runtime_error(msg) {} };
- Style();
+ Style(Environment&);
~Style();
void loadJSON(const uint8_t *const data);
size_t layerCount() const;
+
+ void updateSources(Map&,
+ Environment&,
+ uv::worker&,
+ TexturePool&,
+ std::function<void()> callback);
+
void updateProperties(float z, std::chrono::steady_clock::time_point now);
void setDefaultTransitionDuration(std::chrono::steady_clock::duration duration = std::chrono::steady_clock::duration::zero());
@@ -39,19 +55,24 @@ public:
bool hasTransitions() const;
- const std::string &getSpriteURL() const;
+ const std::unique_ptr<GlyphAtlas> glyphAtlas;
+ const std::unique_ptr<SpriteAtlas> spriteAtlas;
+ const std::unique_ptr<LineAtlas> lineAtlas;
util::ptr<StyleLayerGroup> layers;
- std::vector<std::string> appliedClasses;
- std::string glyph_url;
+ std::set<util::ptr<StyleSource>> activeSources;
std::string base;
private:
std::string sprite_url;
+ std::string glyph_url;
PropertyTransition defaultTransition;
bool initial_render_complete = false;
std::unique_ptr<uv::rwlock> mtx;
ZoomHistory zoomHistory;
+
+ const std::unique_ptr<GlyphStore> glyphStore;
+ util::ptr<Sprite> sprite;
};
}