summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-11-26 16:01:15 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-11-26 16:01:15 -0800
commit12bf2fd326c1b37f44c35e28a38fa6f973830aa5 (patch)
tree3af48663ddc38be4bf55ce7c1ecabf9549bc4542 /src
parent78f11ae94768cc1d73df07b63a9edf7a54db2941 (diff)
downloadqtlocation-mapboxgl-12bf2fd326c1b37f44c35e28a38fa6f973830aa5.tar.gz
Inline Source::updateTiles()
Diffstat (limited to 'src')
-rw-r--r--src/map/source.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/map/source.cpp b/src/map/source.cpp
index 5b32cbafb4..6523ea5d62 100644
--- a/src/map/source.cpp
+++ b/src/map/source.cpp
@@ -61,23 +61,6 @@ 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,
- std::function<void ()> callback) {
- if (loaded && map.getTime() > updated) {
- return updateTiles(map, worker, style,
- glyphAtlas, glyphStore,
- spriteAtlas, sprite,
- texturepool, fileSource,
- callback);
- } else {
- return false;
- }
-}
-
void Source::updateClipIDs(const std::map<Tile::ID, ClipID> &mapping) {
std::for_each(tiles.begin(), tiles.end(), [&mapping](std::pair<const Tile::ID, std::unique_ptr<Tile>> &pair) {
Tile &tile = *pair.second;
@@ -299,11 +282,15 @@ bool Source::findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::
return false;
}
-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,
- std::function<void ()> callback) {
+void 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,
+ std::function<void ()> callback) {
+ if (!loaded || map.getTime() <= updated)
+ return;
+
bool changed = false;
int32_t zoom = std::floor(getZoom(map.getState()));
@@ -377,8 +364,6 @@ bool Source::updateTiles(Map& map, uv::worker& worker, util::ptr<Style> style,
});
updated = map.getTime();
-
- return changed;
}
}