summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-05 14:37:49 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-06 16:17:58 +0300
commita1ed9f879408a12e462196d961075c2ae3d7486e (patch)
treec986802e5f39995981c94a32cb733d64142b7786 /src
parent754d2f377aa1b8993ca5365109dfec98475e6de4 (diff)
downloadqtlocation-mapboxgl-a1ed9f879408a12e462196d961075c2ae3d7486e.tar.gz
[core] Don't upload empty buckets
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/bucket.hpp5
-rw-r--r--src/mbgl/renderer/buckets/symbol_bucket.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp
index 6c391cf014..a411daf3d4 100644
--- a/src/mbgl/renderer/bucket.hpp
+++ b/src/mbgl/renderer/bucket.hpp
@@ -28,6 +28,9 @@ public:
Bucket() = default;
virtual ~Bucket() = default;
+ // Feature geometries are also used to populate the feature index.
+ // Obtaining these is a costly operation, so we do it only once, and
+ // pass-by-const-ref the geometries as a second parameter.
virtual void addFeature(const GeometryTileFeature&,
const GeometryCollection&) {};
@@ -46,7 +49,7 @@ public:
};
bool needsUpload() const {
- return !uploaded;
+ return hasData() && !uploaded;
}
protected:
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp
index cbddade899..28e6a47250 100644
--- a/src/mbgl/renderer/buckets/symbol_bucket.cpp
+++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp
@@ -69,8 +69,7 @@ void SymbolBucket::render(Painter& painter,
}
bool SymbolBucket::hasData() const {
- assert(false); // Should be calling SymbolLayout::has{Text,Icon,CollisonBox}Data() instead.
- return false;
+ return hasTextData() || hasIconData() || hasCollisionBoxData();
}
bool SymbolBucket::hasTextData() const {