diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-26 16:01:15 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-26 16:01:15 -0800 |
commit | 12bf2fd326c1b37f44c35e28a38fa6f973830aa5 (patch) | |
tree | 3af48663ddc38be4bf55ce7c1ecabf9549bc4542 | |
parent | 78f11ae94768cc1d73df07b63a9edf7a54db2941 (diff) | |
download | qtlocation-mapboxgl-12bf2fd326c1b37f44c35e28a38fa6f973830aa5.tar.gz |
Inline Source::updateTiles()
-rw-r--r-- | include/mbgl/map/source.hpp | 9 | ||||
-rw-r--r-- | src/map/source.cpp | 33 |
2 files changed, 10 insertions, 32 deletions
diff --git a/include/mbgl/map/source.hpp b/include/mbgl/map/source.hpp index 299c7accac..c36376fd5d 100644 --- a/include/mbgl/map/source.hpp +++ b/include/mbgl/map/source.hpp @@ -35,7 +35,7 @@ public: Source(SourceInfo&); void load(Map&, FileSource&); - bool update(Map&, uv::worker&, + void update(Map&, uv::worker&, util::ptr<Style>, GlyphAtlas&, GlyphStore&, SpriteAtlas&, util::ptr<Sprite>, @@ -59,13 +59,6 @@ private: int32_t coveringZoomLevel(const TransformState&) const; std::forward_list<Tile::ID> coveringTiles(const TransformState&) const; - bool updateTiles(Map&, uv::worker&, - util::ptr<Style>, - GlyphAtlas&, GlyphStore&, - SpriteAtlas&, util::ptr<Sprite>, - Texturepool&, FileSource&, - std::function<void ()> callback); - TileData::State addTile(Map&, uv::worker&, util::ptr<Style>, GlyphAtlas&, GlyphStore&, 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; } } |