summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-12 14:40:21 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-08-08 15:52:41 +0300
commit1b795ea19b6d20b3ea5d8e1048541299e8dbf38d (patch)
tree344945155dda0a6f6493da3fbeca5e03cc0ef90e
parent12b8482718bdacb2de14e8aa10059e83ecbf61d1 (diff)
downloadqtlocation-mapboxgl-upstream/pitch-67.5-degrees.tar.gz
[core] Do not render symbol layers for pan tilesupstream/pitch-67.5-degrees
-rw-r--r--src/mbgl/renderer/tile_pyramid.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp
index 2bf56b18a8..9f0801801a 100644
--- a/src/mbgl/renderer/tile_pyramid.cpp
+++ b/src/mbgl/renderer/tile_pyramid.cpp
@@ -100,6 +100,15 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
std::vector<UnwrappedTileID> idealTiles;
std::vector<UnwrappedTileID> panTiles;
+ bool usePanLayers = true;
+ std::vector<Immutable<style::Layer::Impl>> panLayers;
+ panLayers.reserve(layers.size());
+ for (const auto& layer : layers) {
+ if (layer->type == LayerType::Symbol)
+ continue;
+ panLayers.emplace_back(layer);
+ }
+
if (overscaledZoom >= zoomRange.min) {
uint8_t idealZoom = std::min(zoomRange.max, overscaledZoom);
@@ -141,7 +150,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
}
if (needsRelayout) {
- tile.setLayers(layers);
+ tile.setLayers(usePanLayers ? panLayers : layers);
}
};
auto getTileFn = [&](const OverscaledTileID& tileID) -> Tile* {
@@ -165,7 +174,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
tile = createTile(tileID);
if (tile) {
tile->setObserver(observer);
- tile->setLayers(layers);
+ tile->setLayers(usePanLayers ? panLayers : layers);
}
}
if (!tile) {
@@ -182,7 +191,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
auto renderTileFn = [&](const UnwrappedTileID& tileID, Tile& tile) {
renderTiles.emplace_back(tileID, tile);
previouslyRenderedTiles.erase(tileID); // Still rendering this tile, no need for special fading logic.
- tile.markRenderedIdeal();
+ if (!usePanLayers) tile.markRenderedIdeal();
};
renderTiles.clear();
@@ -192,6 +201,7 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
panTiles, zoomRange, panZoom);
}
+ usePanLayers = false;
algorithm::updateRenderables(getTileFn, createTileFn, retainTileFn, renderTileFn,
idealTiles, zoomRange, tileZoom);