summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-02 12:54:30 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-02 20:45:46 +0300
commitff6a3ee5b7fea7f4c18fed3480308c34fd434ed6 (patch)
tree46dad3916a6a76b53b77dcee40f8c9619b46c9f9 /src
parent6965fc310042dd6afd07e03baf9aff67d0f97ab6 (diff)
downloadqtlocation-mapboxgl-ff6a3ee5b7fea7f4c18fed3480308c34fd434ed6.tar.gz
[core] Suppress network requests for invisible tiles
If the render source does not need rendering, we set necessity for its tiles to `optional`, and thus suppress network requests on tiles expiration.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/tile_pyramid.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp
index 2bf6e2e1a9..586d3b5a8a 100644
--- a/src/mbgl/renderer/tile_pyramid.cpp
+++ b/src/mbgl/renderer/tile_pyramid.cpp
@@ -68,6 +68,10 @@ void TilePyramid::update(const std::vector<Immutable<style::LayerProperties>>& l
if (!needsRendering) {
if (!needsRelayout) {
for (auto& entry : tiles) {
+ // These tiles are invisible, we set optional necessity
+ // for them and thus suppress network requests on
+ // tiles expiration (see `OnlineFileRequest`).
+ entry.second->setNecessity(TileNecessity::Optional);
cache.add(entry.first, std::move(entry.second));
}
}