summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-11 17:24:40 +0100
committerJesse Bounds <jesse@rebounds.net>2016-11-14 10:33:21 -0800
commitf968ede11b162eff03d892b7e9aa72b04628bb8f (patch)
tree717b9aace7a65187671a0a6695d26fa6f9d61632 /src
parent44e398865e7fa2b0186b9b93c9efcfa53e985566 (diff)
downloadqtlocation-mapboxgl-f968ede11b162eff03d892b7e9aa72b04628bb8f.tar.gz
[core] don't run symbol placement more often than necessary
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/tile/geometry_tile.cpp4
-rw-r--r--src/mbgl/tile/geometry_tile.hpp3
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp1
3 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index c77467ebc1..84455e4787 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -57,11 +57,12 @@ void GeometryTile::setData(std::unique_ptr<const GeometryTileData> data_) {
}
void GeometryTile::setPlacementConfig(const PlacementConfig& desiredConfig) {
- if (placedConfig == desiredConfig) {
+ if (requestedConfig == desiredConfig) {
return;
}
++correlationID;
+ requestedConfig = desiredConfig;
worker.invoke(&GeometryTileWorker::setPlacementConfig, desiredConfig, correlationID);
}
@@ -112,7 +113,6 @@ void GeometryTile::onPlacement(PlacementResult result) {
buckets[bucket.first] = std::move(bucket.second);
}
featureIndex->setCollisionTile(std::move(result.collisionTile));
- placedConfig = result.placedConfig;
observer->onTileChanged(*this);
}
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index cb3ca54633..86243e8a09 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -61,7 +61,6 @@ public:
public:
std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
std::unique_ptr<CollisionTile> collisionTile;
- PlacementConfig placedConfig;
uint64_t correlationID;
};
void onPlacement(PlacementResult);
@@ -79,7 +78,7 @@ private:
Actor<GeometryTileWorker> worker;
uint64_t correlationID = 0;
- optional<PlacementConfig> placedConfig;
+ optional<PlacementConfig> requestedConfig;
std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
std::unique_ptr<FeatureIndex> featureIndex;
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index 6ff3c67793..abb3894d34 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -321,7 +321,6 @@ void GeometryTileWorker::attemptPlacement() {
parent.invoke(&GeometryTile::onPlacement, GeometryTile::PlacementResult {
std::move(buckets),
std::move(collisionTile),
- *placementConfig,
correlationID
});
}