diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2018-11-13 17:39:26 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2018-11-19 14:06:21 +0200 |
commit | 77911f1cc955b1adeb143dd15f6fc0d77763440c (patch) | |
tree | e8a84100c7eae6ab23ffc1a4420db3ed6760dd01 /src/mbgl/text/cross_tile_symbol_index.cpp | |
parent | 20c471669c102d1740558c2c7d1ea77bb9ef8530 (diff) | |
download | qtlocation-mapboxgl-77911f1cc955b1adeb143dd15f6fc0d77763440c.tar.gz |
[core] Replace RenderSymbolLayer downcast with symbol interface
Diffstat (limited to 'src/mbgl/text/cross_tile_symbol_index.cpp')
-rw-r--r-- | src/mbgl/text/cross_tile_symbol_index.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mbgl/text/cross_tile_symbol_index.cpp b/src/mbgl/text/cross_tile_symbol_index.cpp index 98b9af1f94..0992433ccb 100644 --- a/src/mbgl/text/cross_tile_symbol_index.cpp +++ b/src/mbgl/text/cross_tile_symbol_index.cpp @@ -1,6 +1,7 @@ #include <mbgl/text/cross_tile_symbol_index.hpp> #include <mbgl/layout/symbol_instance.hpp> #include <mbgl/renderer/buckets/symbol_bucket.hpp> +#include <mbgl/renderer/layers/render_layer_symbol_interface.hpp> #include <mbgl/renderer/render_tile.hpp> #include <mbgl/tile/tile.hpp> @@ -164,27 +165,27 @@ bool CrossTileSymbolLayerIndex::removeStaleBuckets(const std::unordered_set<uint CrossTileSymbolIndex::CrossTileSymbolIndex() {} -bool CrossTileSymbolIndex::addLayer(RenderSymbolLayer& symbolLayer, float lng) { +bool CrossTileSymbolIndex::addLayer(const RenderLayerSymbolInterface& symbolInterface, float lng) { - auto& layerIndex = layerIndexes[symbolLayer.getID()]; + auto& layerIndex = layerIndexes[symbolInterface.layerID()]; bool symbolBucketsChanged = false; std::unordered_set<uint32_t> currentBucketIDs; layerIndex.handleWrapJump(lng); - for (RenderTile& renderTile : symbolLayer.renderTiles) { + for (const RenderTile& renderTile : symbolInterface.getRenderTiles()) { if (!renderTile.tile.isRenderable()) { continue; } - auto bucket = renderTile.tile.getBucket<SymbolBucket>(*symbolLayer.baseImpl); + auto bucket = symbolInterface.getSymbolBucket(renderTile); if (!bucket) { continue; } SymbolBucket& symbolBucket = *bucket; - if (symbolBucket.bucketLeaderID != symbolLayer.getID()) { + if (symbolBucket.bucketLeaderID != symbolInterface.layerID()) { // Only add this layer if it's the "group leader" for the bucket continue; } |