diff options
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/placement.cpp | 7 | ||||
-rw-r--r-- | src/mbgl/text/placement.hpp | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index e62be00b47..a6de0baba7 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -105,6 +105,13 @@ Placement::Placement(std::shared_ptr<const UpdateParameters> updateParameters_, Placement::Placement() : collisionIndex({}, MapMode::Static), collisionGroups(true) {} +void Placement::placeLayers(const RenderLayerReferences& layers) { + for (auto it = layers.crbegin(); it != layers.crend(); ++it) { + placeLayer(*it); + } + commit(); +} + void Placement::placeLayer(const RenderLayer& layer) { std::set<uint32_t> seenCrossTileIDs; for (const BucketPlacementData& data : layer.getPlacementData()) { diff --git a/src/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp index d3f92eb068..dcb67fa8c8 100644 --- a/src/mbgl/text/placement.hpp +++ b/src/mbgl/text/placement.hpp @@ -108,9 +108,7 @@ class Placement { public: Placement(std::shared_ptr<const UpdateParameters>, optional<Immutable<Placement>> prevPlacement = nullopt); Placement(); - - void placeLayer(const RenderLayer&); - void commit(); + void placeLayers(const RenderLayerReferences&); void updateLayerBuckets(const RenderLayer&, const TransformState&, bool updateOpacities) const; float symbolFadeChange(TimePoint now) const; bool hasTransitions(TimePoint now) const; @@ -128,6 +126,8 @@ public: private: friend SymbolBucket; void placeSymbolBucket(const BucketPlacementData&, std::set<uint32_t>& seenCrossTileIDs); + void placeLayer(const RenderLayer&); + void commit(); // 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>&) const; |