summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-11-25 16:31:30 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-11-26 15:13:13 -0800
commit9af3b033bf41cd32635172864d58dc169168f9e6 (patch)
treef3e7dc75790f1017821573335dde81e351436282 /src
parentd3ba1071cbaf7bc474206774778fdfdec62fc5e3 (diff)
downloadqtlocation-mapboxgl-9af3b033bf41cd32635172864d58dc169168f9e6.tar.gz
Eliminate Map::getStyle()
Diffstat (limited to 'src')
-rw-r--r--src/map/map.cpp2
-rw-r--r--src/map/source.cpp16
-rw-r--r--src/map/vector_tile_data.cpp4
3 files changed, 16 insertions, 6 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index e4c5ec92ee..f2822f3967 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -643,7 +643,7 @@ void Map::updateSources(const util::ptr<StyleLayerGroup> &group) {
void Map::updateTiles() {
for (const util::ptr<StyleSource> &source : getActiveSources()) {
source->source->update(*this, getWorker(),
- glyphAtlas, *glyphStore,
+ style, glyphAtlas, *glyphStore,
spriteAtlas, getSprite(),
*texturepool, *fileSource);
}
diff --git a/src/map/source.cpp b/src/map/source.cpp
index d7f951850b..0348e02513 100644
--- a/src/map/source.cpp
+++ b/src/map/source.cpp
@@ -62,11 +62,15 @@ void Source::load(Map& map, FileSource& fileSource) {
}
bool Source::update(Map& map, uv::worker& worker,
+ util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource) {
if (loaded && map.getTime() > updated) {
- return updateTiles(map, worker, glyphAtlas, glyphStore, spriteAtlas, sprite, texturepool, fileSource);
+ return updateTiles(map, worker, style,
+ glyphAtlas, glyphStore,
+ spriteAtlas, sprite,
+ texturepool, fileSource);
} else {
return false;
}
@@ -163,6 +167,7 @@ TileData::State Source::hasTile(const Tile::ID& id) {
}
TileData::State Source::addTile(Map& map, uv::worker& worker,
+ util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
FileSource& fileSource, Texturepool& texturepool,
@@ -194,7 +199,10 @@ TileData::State Source::addTile(Map& map, uv::worker& worker,
if (!new_tile.data) {
// If we don't find working tile data, we're just going to load it.
if (info->type == SourceType::Vector) {
- new_tile.data = std::make_shared<VectorTileData>(normalized_id, map, glyphAtlas, glyphStore, spriteAtlas, sprite, texturepool, info);
+ new_tile.data = std::make_shared<VectorTileData>(normalized_id, map, style,
+ glyphAtlas, glyphStore,
+ spriteAtlas, sprite,
+ texturepool, info);
} else if (info->type == SourceType::Raster) {
new_tile.data = std::make_shared<RasterTileData>(normalized_id, map, texturepool, info);
} else {
@@ -288,7 +296,7 @@ bool Source::findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::
return false;
}
-bool Source::updateTiles(Map& map, uv::worker& worker,
+bool Source::updateTiles(Map& map, uv::worker& worker, util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource) {
@@ -308,7 +316,7 @@ bool Source::updateTiles(Map& map, uv::worker& worker,
// Add existing child/parent tiles if the actual tile is not yet loaded
for (const Tile::ID& id : required) {
- const TileData::State state = addTile(map, worker,
+ const TileData::State state = addTile(map, worker, style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
fileSource, texturepool,
diff --git a/src/map/vector_tile_data.cpp b/src/map/vector_tile_data.cpp
index 92803d6b65..e662379abb 100644
--- a/src/map/vector_tile_data.cpp
+++ b/src/map/vector_tile_data.cpp
@@ -9,6 +9,7 @@
using namespace mbgl;
VectorTileData::VectorTileData(Tile::ID const& id_, Map &map_,
+ util::ptr<Style> style_,
GlyphAtlas& glyphAtlas_, GlyphStore& glyphStore_,
SpriteAtlas& spriteAtlas_, util::ptr<Sprite> sprite_,
Texturepool& texturepool_,
@@ -19,6 +20,7 @@ VectorTileData::VectorTileData(Tile::ID const& id_, Map &map_,
spriteAtlas(spriteAtlas_),
sprite(sprite_),
texturepool(texturepool_),
+ style(style_),
depth(id.z >= source->max_zoom ? map.getMaxZoom() - id.z : 1) {
}
@@ -36,7 +38,7 @@ void VectorTileData::parse() {
// Parsing creates state that is encapsulated in TileParser. While parsing,
// the TileParser object writes results into this objects. All other state
// is going to be discarded afterwards.
- TileParser parser(data, *this, map.getStyle(),
+ TileParser parser(data, *this, style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
texturepool);