summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-20 16:55:57 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-22 14:30:26 +0200
commita9d04d7b1ad1ac070f45a3367bec24e9cd4ef074 (patch)
tree961e547f49eec7b3a60241deb4ccaf10734a5bc8 /test
parent4dac2f61c244b6ac3859510e21b2c80c83f25841 (diff)
downloadqtlocation-mapboxgl-a9d04d7b1ad1ac070f45a3367bec24e9cd4ef074.tar.gz
[core] Do not index and place the off-screen symbols for overscaled tiles
For overscaled tiles the viewport might be showing only a small part of the tile, so we filter out the off-screen symbols to improve the performance.
Diffstat (limited to 'test')
-rw-r--r--test/text/cross_tile_symbol_index.test.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/text/cross_tile_symbol_index.test.cpp b/test/text/cross_tile_symbol_index.test.cpp
index f0c78ce632..61597e021f 100644
--- a/test/text/cross_tile_symbol_index.test.cpp
+++ b/test/text/cross_tile_symbol_index.test.cpp
@@ -62,7 +62,7 @@ TEST(CrossTileSymbolLayerIndex, addBucket) {
{},
false /*iconsInText*/};
mainBucket.bucketInstanceId = ++maxBucketInstanceId;
- index.addBucket(mainID, mainBucket);
+ index.addBucket(mainID, mat4{}, mainBucket);
// Assigned new IDs
ASSERT_EQ(mainBucket.symbolInstances.at(0).crossTileID, 1u);
@@ -89,7 +89,7 @@ TEST(CrossTileSymbolLayerIndex, addBucket) {
{},
false /*iconsInText*/};
childBucket.bucketInstanceId = ++maxBucketInstanceId;
- index.addBucket(childID, childBucket);
+ index.addBucket(childID, mat4{}, childBucket);
// matched parent tile
ASSERT_EQ(childBucket.symbolInstances.at(0).crossTileID, 1u);
@@ -117,7 +117,7 @@ TEST(CrossTileSymbolLayerIndex, addBucket) {
{},
false /*iconsInText*/};
parentBucket.bucketInstanceId = ++maxBucketInstanceId;
- index.addBucket(parentID, parentBucket);
+ index.addBucket(parentID, mat4{}, parentBucket);
// matched child tile
ASSERT_EQ(parentBucket.symbolInstances.at(0).crossTileID, 1u);
@@ -145,7 +145,7 @@ TEST(CrossTileSymbolLayerIndex, addBucket) {
{},
false /*iconsInText*/};
grandchildBucket.bucketInstanceId = ++maxBucketInstanceId;
- index.addBucket(grandchildID, grandchildBucket);
+ index.addBucket(grandchildID, mat4{}, grandchildBucket);
// Matches the symbol in `mainBucket`
ASSERT_EQ(grandchildBucket.symbolInstances.at(0).crossTileID, 1u);
@@ -203,7 +203,7 @@ TEST(CrossTileSymbolLayerIndex, resetIDs) {
childBucket.bucketInstanceId = ++maxBucketInstanceId;
// assigns a new id
- index.addBucket(mainID, mainBucket);
+ index.addBucket(mainID, mat4{}, mainBucket);
ASSERT_EQ(mainBucket.symbolInstances.at(0).crossTileID, 1u);
// removes the tile
@@ -211,11 +211,11 @@ TEST(CrossTileSymbolLayerIndex, resetIDs) {
index.removeStaleBuckets(currentIDs);
// assigns a new id
- index.addBucket(childID, childBucket);
+ index.addBucket(childID, mat4{}, childBucket);
ASSERT_EQ(childBucket.symbolInstances.at(0).crossTileID, 2u);
// overwrites the old id to match the already-added tile
- index.addBucket(mainID, mainBucket);
+ index.addBucket(mainID, mat4{}, mainBucket);
ASSERT_EQ(mainBucket.symbolInstances.at(0).crossTileID, 2u);
}
@@ -270,12 +270,12 @@ TEST(CrossTileSymbolLayerIndex, noDuplicatesWithinZoomLevel) {
childBucket.bucketInstanceId = ++maxBucketInstanceId;
// assigns new ids
- index.addBucket(mainID, mainBucket);
+ index.addBucket(mainID, mat4{}, mainBucket);
ASSERT_EQ(mainBucket.symbolInstances.at(0).crossTileID, 1u);
ASSERT_EQ(mainBucket.symbolInstances.at(1).crossTileID, 2u);
// copies parent ids without duplicate ids in this tile
- index.addBucket(childID, childBucket);
+ index.addBucket(childID, mat4{}, childBucket);
ASSERT_EQ(childBucket.symbolInstances.at(0).crossTileID, 1u); // A' copies from A
ASSERT_EQ(childBucket.symbolInstances.at(1).crossTileID, 2u); // B' copies from B
ASSERT_EQ(childBucket.symbolInstances.at(2).crossTileID, 3u); // C' gets new ID
@@ -331,12 +331,12 @@ TEST(CrossTileSymbolLayerIndex, bucketReplacement) {
secondBucket.bucketInstanceId = ++maxBucketInstanceId;
// assigns new ids
- index.addBucket(tileID, firstBucket);
+ index.addBucket(tileID, mat4{}, firstBucket);
ASSERT_EQ(firstBucket.symbolInstances.at(0).crossTileID, 1u);
ASSERT_EQ(firstBucket.symbolInstances.at(1).crossTileID, 2u);
// copies parent ids without duplicate ids in this tile
- index.addBucket(tileID, secondBucket);
+ index.addBucket(tileID, mat4{}, secondBucket);
ASSERT_EQ(secondBucket.symbolInstances.at(0).crossTileID, 1u); // A' copies from A
ASSERT_EQ(secondBucket.symbolInstances.at(1).crossTileID, 2u); // B' copies from B
ASSERT_EQ(secondBucket.symbolInstances.at(2).crossTileID, 3u); // C' gets new ID