diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-19 16:16:51 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-22 12:23:39 +0300 |
commit | 3184cb29db069e990dab1ea4e784aad0aaa1048b (patch) | |
tree | 61b0471d4c138671483be829a1d8eb5a286479e5 | |
parent | d48ec2769678985d2108f0731ff4b65ce586d3fb (diff) | |
download | qtlocation-mapboxgl-3184cb29db069e990dab1ea4e784aad0aaa1048b.tar.gz |
[core] sizeof(SymbolBucket) 2312 -> 2296
-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; |