summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-09-20 12:07:02 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-09-21 12:12:35 +0200
commit2ea0833ecf46ba6a38211e980a9200e7f4419bd8 (patch)
treef849687bc067927beb4164ba76265cf1a600c01d /src
parentf49a9ca1de70c8249738ca42ab1c8c86fecf1623 (diff)
downloadqtlocation-mapboxgl-2ea0833ecf46ba6a38211e980a9200e7f4419bd8.tar.gz
[core] don't break ascent in the overscaled tile phase
We optimize our updateRenderable algorithm by breaking ascent when we've already checked a certain tile. So far, we've compared the UnwrappedTileIDs, but they don't include the overscale component. When ascending through overscaled tile IDs, we've stopped the ascent too early, when we should've kept the search going.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/algorithm/update_renderables.hpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mbgl/algorithm/update_renderables.hpp b/src/mbgl/algorithm/update_renderables.hpp
index 5fbe0d943f..57cd4f41ec 100644
--- a/src/mbgl/algorithm/update_renderables.hpp
+++ b/src/mbgl/algorithm/update_renderables.hpp
@@ -21,7 +21,7 @@ void updateRenderables(GetTileFn getTile,
const IdealTileIDs& idealTileIDs,
const Range<uint8_t>& zoomRange,
const uint8_t dataTileZoom) {
- std::unordered_set<UnwrappedTileID> checked;
+ std::unordered_set<OverscaledTileID> checked;
bool covered;
int32_t overscaledZ;
@@ -85,14 +85,13 @@ void updateRenderables(GetTileFn getTile,
// We couldn't find child tiles that entirely cover the ideal tile.
for (overscaledZ = dataTileZoom - 1; overscaledZ >= zoomRange.min; --overscaledZ) {
const auto parentDataTileID = idealDataTileID.scaledTo(overscaledZ);
- const auto parentRenderTileID = parentDataTileID.toUnwrapped();
- if (checked.find(parentRenderTileID) != checked.end()) {
+ if (checked.find(parentDataTileID) != checked.end()) {
// Break parent tile ascent, this route has been checked by another child
// tile before.
break;
} else {
- checked.emplace(parentRenderTileID);
+ checked.emplace(parentDataTileID);
}
tile = getTile(parentDataTileID);
@@ -117,7 +116,7 @@ void updateRenderables(GetTileFn getTile,
parentIsLoaded = tile->isLoaded();
if (tile->isRenderable()) {
- renderTile(parentRenderTileID, *tile);
+ renderTile(parentDataTileID.toUnwrapped(), *tile);
// Break parent tile ascent, since we found one.
break;
}