summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-09-14 12:34:57 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-09-14 13:41:56 -0700
commita9f5224664905ac28a372be6aad429a31790df03 (patch)
tree08d5ff56508e9683918371f7c08251e7e7e5272a
parentc8217a873940264387a7d8101f968798ac7d543e (diff)
downloadqtlocation-mapboxgl-a9f5224664905ac28a372be6aad429a31790df03.tar.gz
[core] Avoid gratuitous SymbolBucket creation
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp3
-rw-r--r--src/mbgl/tile/tile_worker.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index 39fcb91e0c..2fd1bee951 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -40,7 +40,8 @@ void SymbolBucket::render(Painter& painter,
}
bool SymbolBucket::hasData() const {
- return hasTextData() || hasIconData();
+ assert(false); // Should be calling SymbolLayout::hasSymbolInstances() instead.
+ return false;
}
bool SymbolBucket::hasTextData() const {
diff --git a/src/mbgl/tile/tile_worker.cpp b/src/mbgl/tile/tile_worker.cpp
index 572f9054cd..97e682d697 100644
--- a/src/mbgl/tile/tile_worker.cpp
+++ b/src/mbgl/tile/tile_worker.cpp
@@ -167,9 +167,9 @@ TilePlacementResult TileWorker::redoPlacement(const PlacementConfig& config) {
for (auto& symbolLayout : symbolLayouts) {
symbolLayout->state = SymbolLayout::Placed;
- std::unique_ptr<Bucket> bucket = symbolLayout->place(*result.collisionTile);
- if (bucket->hasData() || symbolLayout->hasSymbolInstances()) {
- result.buckets.emplace(symbolLayout->bucketName, std::move(bucket));
+ if (symbolLayout->hasSymbolInstances()) {
+ result.buckets.emplace(symbolLayout->bucketName,
+ symbolLayout->place(*result.collisionTile));
}
}