diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-25 16:31:30 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-26 15:13:13 -0800 |
commit | 9af3b033bf41cd32635172864d58dc169168f9e6 (patch) | |
tree | f3e7dc75790f1017821573335dde81e351436282 /src/map | |
parent | d3ba1071cbaf7bc474206774778fdfdec62fc5e3 (diff) | |
download | qtlocation-mapboxgl-9af3b033bf41cd32635172864d58dc169168f9e6.tar.gz |
Eliminate Map::getStyle()
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.cpp | 2 | ||||
-rw-r--r-- | src/map/source.cpp | 16 | ||||
-rw-r--r-- | src/map/vector_tile_data.cpp | 4 |
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); |