diff options
Diffstat (limited to 'src/mbgl/text/placement.hpp')
-rw-r--r-- | src/mbgl/text/placement.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp index 673ea59c24..3f2a7b8a03 100644 --- a/src/mbgl/text/placement.hpp +++ b/src/mbgl/text/placement.hpp @@ -12,6 +12,7 @@ namespace mbgl { class RenderLayerSymbolInterface; class SymbolBucket; +class SymbolInstance; class OpacityState { public: @@ -90,9 +91,9 @@ private: class Placement { public: - Placement(const TransformState&, MapMode, style::TransitionOptions, const bool crossSourceCollisions); + Placement(const TransformState&, MapMode, style::TransitionOptions, const bool crossSourceCollisions, std::unique_ptr<Placement> prevPlacementOrNull = nullptr); void placeLayer(const RenderLayerSymbolInterface&, const mat4&, bool showCollisionBoxes); - void commit(const Placement& prevPlacement, TimePoint); + void commit(TimePoint); void updateLayerOpacities(const RenderLayerSymbolInterface&); float symbolFadeChange(TimePoint now) const; bool hasTransitions(TimePoint now) const; @@ -104,8 +105,10 @@ public: void setStale(); const RetainedQueryData& getQueryData(uint32_t bucketInstanceId) const; -private: + using VariableOffsets = std::reference_wrapper<const std::unordered_map<uint32_t, VariableOffset>>; + VariableOffsets getVariableOffsets() const { return std::cref(variableOffsets); } +private: void placeLayerBucket( SymbolBucket&, const mat4& posMatrix, @@ -119,6 +122,7 @@ private: const CollisionGroups::CollisionGroup& collisionGroup); void updateBucketOpacities(SymbolBucket&, std::set<uint32_t>&); + void markUsedJustification(SymbolBucket&, style::TextVariableAnchorType, SymbolInstance&); CollisionIndex collisionIndex; @@ -131,17 +135,13 @@ private: std::unordered_map<uint32_t, JointPlacement> placements; std::unordered_map<uint32_t, JointOpacityState> opacities; + std::unordered_map<uint32_t, VariableOffset> variableOffsets; bool stale = false; std::unordered_map<uint32_t, RetainedQueryData> retainedQueryData; CollisionGroups collisionGroups; + std::unique_ptr<Placement> prevPlacement; }; -Point<float> calculateVariableLayoutOffset(style::SymbolAnchorType anchor, - float width, - float height, - float radialOffset, - float textBoxScale); - } // namespace mbgl |