summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/tile_pyramid.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-10-09 12:59:27 +0200
committerKonstantin Käfer <mail@kkaefer.com>2017-10-12 17:58:03 +0200
commit78ea88d757ecf3a0a75b786ae343d746617ba46b (patch)
tree10efd5d389ce7290526e58b393a4c11b73ce3fe0 /src/mbgl/renderer/tile_pyramid.cpp
parent56446c5d17ac74aa9bf39bdd3c8d1e9629d8fd41 (diff)
downloadqtlocation-mapboxgl-78ea88d757ecf3a0a75b786ae343d746617ba46b.tar.gz
[core] make forcing cache/network only more explicit
Previously, we used the existence of a `prior*` field in the Resource object as an indication for whether we should consult the cache or not. However, this is prone to error, since a failed cache lookup won't set any prior fields. Therefore, we manually set `priorExpires` to 0. This in turn triggered another bug where generated wrong expiration timestamps when the server response we got was expired (or expired between sending and receiving). This commit changes the flags so that we can now explicitly request CacheOnly/NetworkOnly (or All) loading methods, rather than the implicit Optional/Required naming scheme.
Diffstat (limited to 'src/mbgl/renderer/tile_pyramid.cpp')
-rw-r--r--src/mbgl/renderer/tile_pyramid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp
index 6cd9bd9ebd..3e2311089d 100644
--- a/src/mbgl/renderer/tile_pyramid.cpp
+++ b/src/mbgl/renderer/tile_pyramid.cpp
@@ -121,7 +121,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
// we're actively using, e.g. as a replacement for tile that aren't loaded yet.
std::set<OverscaledTileID> retain;
- auto retainTileFn = [&](Tile& tile, Resource::Necessity necessity) -> void {
+ auto retainTileFn = [&](Tile& tile, TileNecessity necessity) -> void {
if (retain.emplace(tile.id).second) {
tile.setNecessity(necessity);
}
@@ -179,7 +179,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
while (tilesIt != tiles.end()) {
if (retainIt == retain.end() || tilesIt->first < *retainIt) {
if (!needsRelayout) {
- tilesIt->second->setNecessity(Tile::Necessity::Optional);
+ tilesIt->second->setNecessity(TileNecessity::Optional);
cache.add(tilesIt->first, std::move(tilesIt->second));
}
tiles.erase(tilesIt++);