summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/buckets/symbol_bucket.cpp20
-rw-r--r--src/mbgl/renderer/buckets/symbol_bucket.hpp6
2 files changed, 21 insertions, 5 deletions
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp
index 9220235f1d..38342b44ee 100644
--- a/src/mbgl/renderer/buckets/symbol_bucket.cpp
+++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp
@@ -17,7 +17,8 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo
bool iconsNeedLinear_,
bool sortFeaturesByY_,
const std::string bucketName_,
- const std::vector<SymbolInstance>&& symbolInstances_)
+ const std::vector<SymbolInstance>&& symbolInstances_,
+ float tilePixelRatio_)
: layout(std::move(layout_)),
sdfIcons(sdfIcons_),
iconsNeedLinear(iconsNeedLinear_ || iconSize.isDataDriven() || !iconSize.isZoomConstant()),
@@ -25,7 +26,8 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo
bucketLeaderID(std::move(bucketName_)),
symbolInstances(std::move(symbolInstances_)),
textSizeBinder(SymbolSizeBinder::create(zoom, textSize, TextSize::defaultValue())),
- iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())) {
+ iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())),
+ tilePixelRatio(tilePixelRatio_) {
for (const auto& pair : paintProperties_) {
auto layerPaintProperties = pair.second;
@@ -218,12 +220,22 @@ void SymbolBucket::sortFeatures(const float angle) {
const SymbolInstance& symbolInstance = symbolInstances[i];
featureSortOrder->push_back(symbolInstance.dataFeatureIndex);
- if (symbolInstance.placedTextIndex) {
- addPlacedSymbol(text.triangles, text.placedSymbols[*symbolInstance.placedTextIndex]);
+ if (symbolInstance.placedRightTextIndex) {
+ addPlacedSymbol(text.triangles, text.placedSymbols[*symbolInstance.placedRightTextIndex]);
}
+
+ if (symbolInstance.placedCenterTextIndex) {
+ addPlacedSymbol(text.triangles, text.placedSymbols[*symbolInstance.placedCenterTextIndex]);
+ }
+
+ if (symbolInstance.placedLeftTextIndex) {
+ addPlacedSymbol(text.triangles, text.placedSymbols[*symbolInstance.placedLeftTextIndex]);
+ }
+
if (symbolInstance.placedVerticalTextIndex) {
addPlacedSymbol(text.triangles, text.placedSymbols[*symbolInstance.placedVerticalTextIndex]);
}
+
if (symbolInstance.placedIconIndex) {
addPlacedSymbol(icon.triangles, icon.placedSymbols[*symbolInstance.placedIconIndex]);
}
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp
index fafa2592fe..f8ffc1a8eb 100644
--- a/src/mbgl/renderer/buckets/symbol_bucket.hpp
+++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp
@@ -35,6 +35,8 @@ public:
std::vector<float> glyphOffsets;
bool hidden;
size_t vertexStartIndex;
+ // The crossTileID is only filled/used on the foreground for variable text anchors
+ uint32_t crossTileID = 0u;
};
class SymbolBucket final : public Bucket {
@@ -48,7 +50,8 @@ public:
bool iconsNeedLinear,
bool sortFeaturesByY,
const std::string bucketLeaderID,
- const std::vector<SymbolInstance>&&);
+ const std::vector<SymbolInstance>&&,
+ const float tilePixelRatio);
~SymbolBucket() override;
void upload(gfx::Context&) override;
@@ -130,6 +133,7 @@ public:
optional<gfx::IndexBuffer> indexBuffer;
} collisionCircle;
+ const float tilePixelRatio;
uint32_t bucketInstanceId = 0;
bool justReloaded = false;
optional<bool> hasFormatSectionOverrides_;