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.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index af19c41393..a75133f82d 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -1,6 +1,6 @@
#include <mbgl/style/style.hpp>
#include <mbgl/style/observer.hpp>
-#include <mbgl/style/source.hpp>
+#include <mbgl/style/source_impl.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/style/layers/symbol_layer_impl.hpp>
#include <mbgl/style/layers/custom_layer.hpp>
@@ -47,7 +47,7 @@ Style::Style(FileSource& fileSource_, float pixelRatio)
Style::~Style() {
for (const auto& source : sources) {
- source->setObserver(nullptr);
+ source->baseImpl->setObserver(nullptr);
}
glyphStore->setObserver(nullptr);
@@ -107,7 +107,7 @@ void Style::setJSON(const std::string& json) {
}
void Style::addSource(std::unique_ptr<Source> source) {
- source->setObserver(this);
+ source->baseImpl->setObserver(this);
sources.emplace_back(std::move(source));
}
@@ -156,7 +156,7 @@ void Style::update(const UpdateParameters& parameters) {
bool allTilesUpdated = true;
for (const auto& source : sources) {
- if (!source->update(parameters)) {
+ if (!source->baseImpl->update(parameters)) {
allTilesUpdated = false;
}
}
@@ -195,7 +195,7 @@ void Style::cascade(const TimePoint& timePoint, MapMode mode) {
void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
for (const auto& source : sources) {
- source->enabled = false;
+ source->baseImpl->enabled = false;
}
zoomHistory.update(z, timePoint);
@@ -213,9 +213,9 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
Source* source = getSource(layer->baseImpl->source);
if (source && layer->baseImpl->needsRendering()) {
- source->enabled = true;
- if (!source->loaded) {
- source->load(fileSource);
+ source->baseImpl->enabled = true;
+ if (!source->baseImpl->loaded) {
+ source->baseImpl->load(fileSource);
}
}
}
@@ -223,7 +223,7 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
Source* Style::getSource(const std::string& id) const {
const auto it = std::find_if(sources.begin(), sources.end(), [&](const auto& source) {
- return source->id == id;
+ return source->getID() == id;
});
return it != sources.end() ? it->get() : nullptr;
@@ -239,7 +239,7 @@ bool Style::isLoaded() const {
}
for (const auto& source: sources) {
- if (source->enabled && !source->isLoaded()) return false;
+ if (source->baseImpl->enabled && !source->baseImpl->isLoaded()) return false;
}
if (!spriteStore->isLoaded()) {
@@ -253,7 +253,7 @@ RenderData Style::getRenderData() const {
RenderData result;
for (const auto& source : sources) {
- if (source->enabled) {
+ if (source->baseImpl->enabled) {
result.sources.insert(source.get());
}
}
@@ -285,7 +285,7 @@ RenderData Style::getRenderData() const {
continue;
}
- for (auto& pair : source->getRenderTiles()) {
+ for (auto& pair : source->baseImpl->getRenderTiles()) {
auto& tile = pair.second;
if (!tile.tile.isRenderable()) {
continue;
@@ -324,7 +324,7 @@ std::vector<Feature> Style::queryRenderedFeatures(const QueryParameters& paramet
std::unordered_map<std::string, std::vector<Feature>> resultsByLayer;
for (const auto& source : sources) {
- auto sourceResults = source->queryRenderedFeatures(parameters);
+ auto sourceResults = source->baseImpl->queryRenderedFeatures(parameters);
std::move(sourceResults.begin(), sourceResults.end(), std::inserter(resultsByLayer, resultsByLayer.begin()));
}
@@ -352,13 +352,13 @@ float Style::getQueryRadius() const {
void Style::setSourceTileCacheSize(size_t size) {
for (const auto& source : sources) {
- source->setCacheSize(size);
+ source->baseImpl->setCacheSize(size);
}
}
void Style::onLowMemory() {
for (const auto& source : sources) {
- source->onLowMemory();
+ source->baseImpl->onLowMemory();
}
}
@@ -388,7 +388,7 @@ void Style::onSourceLoaded(Source& source) {
void Style::onSourceError(Source& source, std::exception_ptr error) {
lastError = error;
Log::Error(Event::Style, "Failed to load source %s: %s",
- source.id.c_str(), util::toString(error).c_str());
+ source.getID().c_str(), util::toString(error).c_str());
observer->onSourceError(source, error);
observer->onResourceError(error);
}
@@ -405,7 +405,7 @@ void Style::onTileLoaded(Source& source, const OverscaledTileID& tileID, bool is
void Style::onTileError(Source& source, const OverscaledTileID& tileID, std::exception_ptr error) {
lastError = error;
Log::Error(Event::Style, "Failed to load tile %s for source %s: %s",
- util::toString(tileID).c_str(), source.id.c_str(), util::toString(error).c_str());
+ util::toString(tileID).c_str(), source.getID().c_str(), util::toString(error).c_str());
observer->onTileError(source, tileID, error);
observer->onResourceError(error);
}
@@ -429,7 +429,7 @@ void Style::onSpriteError(std::exception_ptr error) {
void Style::dumpDebugLogs() const {
for (const auto& source : sources) {
- source->dumpDebugLogs();
+ source->baseImpl->dumpDebugLogs();
}
spriteStore->dumpDebugLogs();