summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-11-25 16:22:05 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-11-26 15:13:13 -0800
commitd3ba1071cbaf7bc474206774778fdfdec62fc5e3 (patch)
treeff4bebb1b057c1363e0ce925d013d04a4e87b188 /src
parent576533b18c7ecc93656f840994d90a3bb86ae239 (diff)
downloadqtlocation-mapboxgl-d3ba1071cbaf7bc474206774778fdfdec62fc5e3.tar.gz
Make Map::getSprite() private
Diffstat (limited to 'src')
-rw-r--r--src/map/map.cpp5
-rw-r--r--src/map/source.cpp12
-rw-r--r--src/map/vector_tile_data.cpp5
3 files changed, 13 insertions, 9 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index c0a45b69d9..e4c5ec92ee 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -642,7 +642,10 @@ 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, spriteAtlas, *texturepool, *fileSource);
+ source->source->update(*this, getWorker(),
+ glyphAtlas, *glyphStore,
+ spriteAtlas, getSprite(),
+ *texturepool, *fileSource);
}
}
diff --git a/src/map/source.cpp b/src/map/source.cpp
index d68ea1a167..d7f951850b 100644
--- a/src/map/source.cpp
+++ b/src/map/source.cpp
@@ -63,10 +63,10 @@ void Source::load(Map& map, FileSource& fileSource) {
bool Source::update(Map& map, uv::worker& worker,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
- SpriteAtlas& spriteAtlas,
+ SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource) {
if (loaded && map.getTime() > updated) {
- return updateTiles(map, worker, glyphAtlas, glyphStore, spriteAtlas, texturepool, fileSource);
+ return updateTiles(map, worker, glyphAtlas, glyphStore, spriteAtlas, sprite, texturepool, fileSource);
} else {
return false;
}
@@ -164,7 +164,7 @@ TileData::State Source::hasTile(const Tile::ID& id) {
TileData::State Source::addTile(Map& map, uv::worker& worker,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
- SpriteAtlas& spriteAtlas,
+ SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
FileSource& fileSource, Texturepool& texturepool,
const Tile::ID& id) {
const TileData::State state = hasTile(id);
@@ -194,7 +194,7 @@ 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, texturepool, info);
+ new_tile.data = std::make_shared<VectorTileData>(normalized_id, map, 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 {
@@ -290,7 +290,7 @@ bool Source::findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::
bool Source::updateTiles(Map& map, uv::worker& worker,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
- SpriteAtlas& spriteAtlas,
+ SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource) {
bool changed = false;
@@ -310,7 +310,7 @@ bool Source::updateTiles(Map& map, uv::worker& worker,
for (const Tile::ID& id : required) {
const TileData::State state = addTile(map, worker,
glyphAtlas, glyphStore,
- spriteAtlas,
+ spriteAtlas, sprite,
fileSource, texturepool,
id);
diff --git a/src/map/vector_tile_data.cpp b/src/map/vector_tile_data.cpp
index fde181e2cb..92803d6b65 100644
--- a/src/map/vector_tile_data.cpp
+++ b/src/map/vector_tile_data.cpp
@@ -10,13 +10,14 @@ using namespace mbgl;
VectorTileData::VectorTileData(Tile::ID const& id_, Map &map_,
GlyphAtlas& glyphAtlas_, GlyphStore& glyphStore_,
- SpriteAtlas& spriteAtlas_,
+ SpriteAtlas& spriteAtlas_, util::ptr<Sprite> sprite_,
Texturepool& texturepool_,
const util::ptr<SourceInfo> &source_)
: TileData(id_, map_, source_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),
+ sprite(sprite_),
texturepool(texturepool_),
depth(id.z >= source->max_zoom ? map.getMaxZoom() - id.z : 1) {
}
@@ -37,7 +38,7 @@ void VectorTileData::parse() {
// is going to be discarded afterwards.
TileParser parser(data, *this, map.getStyle(),
glyphAtlas, glyphStore,
- spriteAtlas, map.getSprite(),
+ spriteAtlas, sprite,
texturepool);
parser.parse();
} catch (const std::exception& ex) {