summaryrefslogtreecommitdiff
path: root/src/mbgl/text/cross_tile_symbol_index.hpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-01-16 12:38:27 -0800
committerChris Loer <chris.loer@mapbox.com>2018-01-17 12:49:30 -0800
commitb3d3ab0e31d251cf39dfa78dfbc0661b8819a8ab (patch)
treeb7c33de0d95b31e5852f587d1fedc3cc8861acc0 /src/mbgl/text/cross_tile_symbol_index.hpp
parentfa3dee93f8161f9ee3279a762122d1a3ddd41c2e (diff)
downloadqtlocation-mapboxgl-b3d3ab0e31d251cf39dfa78dfbc0661b8819a8ab.tar.gz
[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.
Diffstat (limited to 'src/mbgl/text/cross_tile_symbol_index.hpp')
-rw-r--r--src/mbgl/text/cross_tile_symbol_index.hpp8
1 files changed, 6 insertions, 2 deletions
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 <mbgl/util/optional.hpp>
#include <map>
+#include <set>
#include <vector>
#include <string>
#include <memory>
@@ -32,7 +33,7 @@ public:
TileLayerIndex(OverscaledTileID coord, std::vector<SymbolInstance>&, uint32_t bucketInstanceId);
Point<int64_t> getScaledCoordinates(SymbolInstance&, const OverscaledTileID&);
- void findMatches(std::vector<SymbolInstance>&, const OverscaledTileID&);
+ void findMatches(std::vector<SymbolInstance>&, const OverscaledTileID&, std::set<uint32_t>&);
OverscaledTileID coord;
uint32_t bucketInstanceId;
@@ -45,7 +46,10 @@ public:
bool addBucket(const OverscaledTileID&, SymbolBucket&, uint32_t& maxCrossTileID);
bool removeStaleBuckets(const std::unordered_set<uint32_t>& currentIDs);
private:
- std::map<uint8_t,std::map<OverscaledTileID,TileLayerIndex>> indexes;
+ void removeBucketCrossTileIDs(uint8_t zoom, const TileLayerIndex& removedBucket);
+
+ std::map<uint8_t, std::map<OverscaledTileID,TileLayerIndex>> indexes;
+ std::map<uint8_t, std::set<uint32_t>> usedCrossTileIDs;
};
class CrossTileSymbolIndex {