From b3d3ab0e31d251cf39dfa78dfbc0661b8819a8ab Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Tue, 16 Jan 2018 12:38:27 -0800 Subject: [core] Prevent symbols at the same zoom from sharing a crossTileID. Port of GL JS PR #5994. Fixes issue #10844, which would allow multiple symbols in a tile to share the same crossTileID as one of their duplicate parent-tile symbols. Once the symbols shared a crossTileID, they would permanently remain "duplicates" of each other, even after increasing zoom level allowed the CrossTileSymbolIndex to distinguish between them. --- src/mbgl/text/cross_tile_symbol_index.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mbgl/text/cross_tile_symbol_index.hpp') diff --git a/src/mbgl/text/cross_tile_symbol_index.hpp b/src/mbgl/text/cross_tile_symbol_index.hpp index 995e0061b9..5abcde241c 100644 --- a/src/mbgl/text/cross_tile_symbol_index.hpp +++ b/src/mbgl/text/cross_tile_symbol_index.hpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -32,7 +33,7 @@ public: TileLayerIndex(OverscaledTileID coord, std::vector&, uint32_t bucketInstanceId); Point getScaledCoordinates(SymbolInstance&, const OverscaledTileID&); - void findMatches(std::vector&, const OverscaledTileID&); + void findMatches(std::vector&, const OverscaledTileID&, std::set&); OverscaledTileID coord; uint32_t bucketInstanceId; @@ -45,7 +46,10 @@ public: bool addBucket(const OverscaledTileID&, SymbolBucket&, uint32_t& maxCrossTileID); bool removeStaleBuckets(const std::unordered_set& currentIDs); private: - std::map> indexes; + void removeBucketCrossTileIDs(uint8_t zoom, const TileLayerIndex& removedBucket); + + std::map> indexes; + std::map> usedCrossTileIDs; }; class CrossTileSymbolIndex { -- cgit v1.2.1