summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r--src/mbgl/style/style.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 1ffd75bf69..e5ba08e57f 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -1,7 +1,7 @@
#include <mbgl/style/style.hpp>
#include <mbgl/map/map_data.hpp>
-#include <mbgl/map/source.hpp>
-#include <mbgl/map/tile.hpp>
+#include <mbgl/source/source.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/map/transform_state.hpp>
#include <mbgl/layer/symbol_layer.hpp>
#include <mbgl/layer/custom_layer.hpp>
@@ -27,9 +27,10 @@
namespace mbgl {
-Style::Style(MapData& data_)
+Style::Style(MapData& data_, FileSource& fileSource_)
: data(data_),
- glyphStore(std::make_unique<GlyphStore>()),
+ fileSource(fileSource_),
+ glyphStore(std::make_unique<GlyphStore>(fileSource)),
glyphAtlas(std::make_unique<GlyphAtlas>(1024, 1024)),
spriteStore(std::make_unique<SpriteStore>(data.pixelRatio)),
spriteAtlas(std::make_unique<SpriteAtlas>(1024, 1024, data.pixelRatio, *spriteStore)),
@@ -55,7 +56,7 @@ void Style::setJSON(const std::string& json, const std::string&) {
}
glyphStore->setURL(parser.glyphURL);
- spriteStore->setURL(parser.spriteURL);
+ spriteStore->load(parser.spriteURL, fileSource);
loaded = true;
}
@@ -116,13 +117,14 @@ void Style::removeLayer(const std::string& id) {
}
void Style::update(const TransformState& transform,
- TexturePool& texturePool) {
+ gl::TexturePool& texturePool) {
bool allTilesUpdated = true;
StyleUpdateParameters parameters(data.pixelRatio,
data.getDebug(),
data.getAnimationTime(),
transform,
workers,
+ fileSource,
texturePool,
shouldReparsePartialTiles,
data.mode,
@@ -180,7 +182,9 @@ void Style::recalculate(float z) {
Source* source = getSource(layer->source);
if (source && layer->needsRendering()) {
source->enabled = true;
- if (!source->loaded && !source->isLoading()) source->load();
+ if (!source->loaded && !source->isLoading()) {
+ source->load(fileSource);
+ }
}
}
}