summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style_impl.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-07 23:24:52 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-08 18:37:41 +0200
commit2144e3f3b0b8f08b65c854225d7360847633f689 (patch)
tree16cadc63b1c3d438c5ddd4bf67aadb2e72e23130 /src/mbgl/style/style_impl.cpp
parent2f88e8257b83b77f6c06c86c99f542976e7d5199 (diff)
downloadqtlocation-mapboxgl-upstream/map-refactor.tar.gz
[core] Implement platform::Factory::sharedFileSource()upstream/map-refactor
Diffstat (limited to 'src/mbgl/style/style_impl.cpp')
-rw-r--r--src/mbgl/style/style_impl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp
index ebddfbcb22..deb77e2ed6 100644
--- a/src/mbgl/style/style_impl.cpp
+++ b/src/mbgl/style/style_impl.cpp
@@ -1,3 +1,4 @@
+#include <mbgl/platform/factory.hpp>
#include <mbgl/style/style_impl.hpp>
#include <mbgl/style/observer.hpp>
#include <mbgl/style/source_impl.hpp>
@@ -27,9 +28,9 @@ namespace style {
static Observer nullObserver;
-Style::Impl::Impl(FileSource& fileSource_, float pixelRatio)
- : fileSource(fileSource_),
- spriteLoader(std::make_unique<SpriteLoader>(pixelRatio)),
+Style::Impl::Impl(float pixelRatio, const FileSourceOptions& fileSourceOptions)
+ : fileSource(platform::Factory::sharedFileSource(fileSourceOptions)),
+ spriteLoader(std::make_unique<SpriteLoader>(pixelRatio, fileSourceOptions)),
light(std::make_unique<Light>()),
observer(&nullObserver) {
spriteLoader->setObserver(this);
@@ -53,7 +54,7 @@ void Style::Impl::loadURL(const std::string& url_) {
loaded = false;
url = url_;
- styleRequest = fileSource.request(Resource::style(url), [this](Response res) {
+ styleRequest = fileSource->request(Resource::style(url), [this](Response res) {
// Don't allow a loaded, mutated style to be overwritten with a new version.
if (mutated && loaded) {
return;
@@ -110,7 +111,7 @@ void Style::Impl::parse(const std::string& json_) {
setLight(std::make_unique<Light>(parser.light));
spriteLoaded = false;
- spriteLoader->load(parser.spriteURL, fileSource);
+ spriteLoader->load(parser.spriteURL);
glyphURL = parser.glyphURL;
loaded = true;