diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-13 17:37:30 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-19 14:51:32 +0300 |
commit | f997ae00ae960f38d6920a625fcb7237e5909f9c (patch) | |
tree | 4478f9e94c4181f68a1d76128e9514800f586d31 /src/mbgl/text | |
parent | 80e8d7a2fcb9f75e585bb7dd26c2f2a893b6f560 (diff) | |
download | qtlocation-mapboxgl-f997ae00ae960f38d6920a625fcb7237e5909f9c.tar.gz |
[core] Fix Placement constness
Update buckets methods do not mutate placement, placement methods do not mutate buckets.
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/placement.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/text/placement.hpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index 06777dea44..9e3600aa97 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -690,7 +690,7 @@ bool Placement::updateBucketDynamicVertices(SymbolBucket& bucket, const Transfor return result; } -void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState& state, std::set<uint32_t>& seenCrossTileIDs) { +void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState& state, std::set<uint32_t>& seenCrossTileIDs) const { if (bucket.hasTextData()) bucket.text.opacityVertices.clear(); if (bucket.hasIconData()) bucket.icon.opacityVertices.clear(); if (bucket.hasSdfIconData()) bucket.sdfIcon.opacityVertices.clear(); @@ -895,7 +895,7 @@ const style::TextJustifyType justifyTypes[] = {style::TextJustifyType::Right, st } // namespace -void Placement::markUsedJustification(SymbolBucket& bucket, style::TextVariableAnchorType placedAnchor, const SymbolInstance& symbolInstance, style::TextWritingModeType orientation) { +void Placement::markUsedJustification(SymbolBucket& bucket, style::TextVariableAnchorType placedAnchor, const SymbolInstance& symbolInstance, style::TextWritingModeType orientation) const { style::TextJustifyType anchorJustify = getAnchorJustification(placedAnchor); assert(anchorJustify != style::TextJustifyType::Auto); const optional<size_t>& autoIndex = justificationToIndex(anchorJustify, symbolInstance, orientation); @@ -915,7 +915,7 @@ void Placement::markUsedJustification(SymbolBucket& bucket, style::TextVariableA } } -void Placement::markUsedOrientation(SymbolBucket& bucket, style::TextWritingModeType orientation, const SymbolInstance& symbolInstance) { +void Placement::markUsedOrientation(SymbolBucket& bucket, style::TextWritingModeType orientation, const SymbolInstance& symbolInstance) const { auto horizontal = orientation == style::TextWritingModeType::Horizontal ? optional<style::TextWritingModeType>(orientation) : nullopt; auto vertical = orientation == style::TextWritingModeType::Vertical ? diff --git a/src/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp index b5405cbcd7..1cefaf978c 100644 --- a/src/mbgl/text/placement.hpp +++ b/src/mbgl/text/placement.hpp @@ -61,7 +61,7 @@ struct RetainedQueryData { uint32_t bucketInstanceId; std::shared_ptr<FeatureIndex> featureIndex; OverscaledTileID tileID; - std::shared_ptr<std::vector<size_t>> featureSortOrder; + mutable FeatureSortOrder featureSortOrder; RetainedQueryData(uint32_t bucketInstanceId_, std::shared_ptr<FeatureIndex> featureIndex_, @@ -122,9 +122,9 @@ private: std::set<uint32_t>& seenCrossTileIDs); // Returns `true` if bucket vertices were updated; returns `false` otherwise. bool updateBucketDynamicVertices(SymbolBucket&, const TransformState&, const RenderTile& tile) const; - void updateBucketOpacities(SymbolBucket&, const TransformState&, std::set<uint32_t>&); - void markUsedJustification(SymbolBucket&, style::TextVariableAnchorType, const SymbolInstance&, style::TextWritingModeType orientation); - void markUsedOrientation(SymbolBucket&, style::TextWritingModeType, const SymbolInstance&); + void updateBucketOpacities(SymbolBucket&, const TransformState&, std::set<uint32_t>&) const; + void markUsedJustification(SymbolBucket&, style::TextVariableAnchorType, const SymbolInstance&, style::TextWritingModeType orientation) const; + void markUsedOrientation(SymbolBucket&, style::TextWritingModeType, const SymbolInstance&) const; float zoomAdjustment(const float zoom) const; Duration getUpdatePeriod(const float zoom) const; |