diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-13 14:45:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-14 11:25:45 -0700 |
commit | 6eab895bc0683881f793a3a751fa7470603ae9a0 (patch) | |
tree | 5e1b231702bb1c93e6a0c8823500a6e6980b0970 /src/mbgl/algorithm | |
parent | 615a6685a47609310930890203f41815a5f19d48 (diff) | |
download | qtlocation-mapboxgl-6eab895bc0683881f793a3a751fa7470603ae9a0.tar.gz |
[core] Use Range<uint8_t> instead of full Tileset where possible
Diffstat (limited to 'src/mbgl/algorithm')
-rw-r--r-- | src/mbgl/algorithm/update_renderables.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mbgl/algorithm/update_renderables.hpp b/src/mbgl/algorithm/update_renderables.hpp index eebabbd211..d47a919bae 100644 --- a/src/mbgl/algorithm/update_renderables.hpp +++ b/src/mbgl/algorithm/update_renderables.hpp @@ -1,6 +1,7 @@ #pragma once #include <mbgl/tile/tile_id.hpp> +#include <mbgl/util/range.hpp> #include <set> @@ -11,14 +12,13 @@ template <typename GetTileFn, typename CreateTileFn, typename RetainTileFn, typename RenderTileFn, - typename IdealTileIDs, - typename SourceInfo> + typename IdealTileIDs> void updateRenderables(GetTileFn getTile, CreateTileFn createTile, RetainTileFn retainTile, RenderTileFn renderTile, const IdealTileIDs& idealTileIDs, - const SourceInfo& info, + const Range<uint8_t>& zoomRange, const uint8_t dataTileZoom) { std::set<UnwrappedTileID> checked; bool covered; @@ -26,8 +26,8 @@ void updateRenderables(GetTileFn getTile, // for (all in the set of ideal tiles of the source) { for (const auto& idealRenderTileID : idealTileIDs) { - assert(idealRenderTileID.canonical.z >= info.minZoom); - assert(idealRenderTileID.canonical.z <= info.maxZoom); + assert(idealRenderTileID.canonical.z >= zoomRange.min); + assert(idealRenderTileID.canonical.z <= zoomRange.max); assert(dataTileZoom >= idealRenderTileID.canonical.z); const OverscaledTileID idealDataTileID(dataTileZoom, idealRenderTileID.canonical); @@ -48,7 +48,7 @@ void updateRenderables(GetTileFn getTile, retainTile(*data, true); covered = true; overscaledZ = dataTileZoom + 1; - if (overscaledZ > info.maxZoom) { + if (overscaledZ > zoomRange.max) { // We're looking for an overzoomed child tile. const auto childDataTileID = idealDataTileID.scaledTo(overscaledZ); data = getTile(childDataTileID); @@ -76,7 +76,7 @@ void updateRenderables(GetTileFn getTile, if (!covered) { // We couldn't find child tiles that entirely cover the ideal tile. - for (overscaledZ = dataTileZoom - 1; overscaledZ >= info.minZoom; --overscaledZ) { + for (overscaledZ = dataTileZoom - 1; overscaledZ >= zoomRange.min; --overscaledZ) { const auto parentDataTileID = idealDataTileID.scaledTo(overscaledZ); const auto parentRenderTileID = parentDataTileID.unwrapTo(idealRenderTileID.wrap); |