diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-11 17:24:40 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-14 10:35:15 +0100 |
commit | a7fa97e8a36bec7c5d6ec5ae43203012e3357cd9 (patch) | |
tree | a75e058ff6780a763454336bf93a18aadf793acb /src | |
parent | 35a66eb2bd9c5d0f1da3a90b1e44ba75114a800a (diff) | |
download | qtlocation-mapboxgl-a7fa97e8a36bec7c5d6ec5ae43203012e3357cd9.tar.gz |
[core] don't run symbol placement more often than necessary
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile_worker.cpp | 1 |
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 }); } |