diff options
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 11 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 26 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index 2ad5318d19..cc26f1b26b 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -25,10 +25,16 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo const std::vector<SymbolInstance>&& symbolInstances_, float tilePixelRatio_) : layout(std::move(layout_)), + bucketLeaderID(std::move(bucketName_)), sdfIcons(sdfIcons_), iconsNeedLinear(iconsNeedLinear_ || iconSize.isDataDriven() || !iconSize.isZoomConstant()), sortFeaturesByY(sortFeaturesByY_), - bucketLeaderID(std::move(bucketName_)), + staticUploaded(false), + placementChangesUploaded(false), + dynamicUploaded(false), + sortUploaded(false), + justReloaded(false), + hasVariablePlacement(false), symbolInstances(std::move(symbolInstances_)), textSizeBinder(SymbolSizeBinder::create(zoom, textSize, TextSize::defaultValue())), iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())), @@ -170,8 +176,9 @@ void SymbolBucket::sortFeatures(const float angle) { if (!sortFeaturesByY) { return; } + assert (angle != std::numeric_limits<float>::max()); - if (sortedAngle && *sortedAngle == angle) { + if (sortedAngle == angle) { return; } diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index f72e832169..bee3e3f7c2 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -73,18 +73,19 @@ public: std::vector<std::reference_wrapper<SymbolInstance>> getSortedSymbols(const float angle); const style::SymbolLayoutProperties::PossiblyEvaluated layout; - const bool sdfIcons; - const bool iconsNeedLinear; - const bool sortFeaturesByY; - const std::string bucketLeaderID; - - optional<float> sortedAngle; - - bool staticUploaded = false; - bool placementChangesUploaded = false; - bool dynamicUploaded = false; - bool sortUploaded = false; + float sortedAngle = std::numeric_limits<float>::max(); + + // Flags + const bool sdfIcons : 1; + const bool iconsNeedLinear : 1; + const bool sortFeaturesByY : 1; + bool staticUploaded : 1; + bool placementChangesUploaded : 1; + bool dynamicUploaded : 1; + bool sortUploaded : 1; + bool justReloaded : 1; + bool hasVariablePlacement : 1; std::vector<SymbolInstance> symbolInstances; @@ -137,8 +138,7 @@ public: const float tilePixelRatio; uint32_t bucketInstanceId; - bool justReloaded = false; - bool hasVariablePlacement = false; + mutable optional<bool> hasFormatSectionOverrides_; std::shared_ptr<std::vector<size_t>> featureSortOrder; |