summaryrefslogtreecommitdiff
path: root/src/mbgl/text/placement.cpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-20 16:55:57 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-22 14:30:26 +0200
commita9d04d7b1ad1ac070f45a3367bec24e9cd4ef074 (patch)
tree961e547f49eec7b3a60241deb4ccaf10734a5bc8 /src/mbgl/text/placement.cpp
parent4dac2f61c244b6ac3859510e21b2c80c83f25841 (diff)
downloadqtlocation-mapboxgl-a9d04d7b1ad1ac070f45a3367bec24e9cd4ef074.tar.gz
[core] Do not index and place the off-screen symbols for overscaled tiles
For overscaled tiles the viewport might be showing only a small part of the tile, so we filter out the off-screen symbols to improve the performance.
Diffstat (limited to 'src/mbgl/text/placement.cpp')
-rw-r--r--src/mbgl/text/placement.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 43d9713717..32edf679e8 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -157,10 +157,7 @@ void Placement::placeBucket(const SymbolBucket& bucket,
const bool rotateIconWithMap = layout.get<style::IconRotationAlignment>() == style::AlignmentType::Map;
const bool pitchIconWithMap = layout.get<style::IconPitchAlignment>() == style::AlignmentType::Map;
- mat4 posMatrix;
- const auto& projMatrix = state.getProjectionMatrix();
- state.matrixFor(posMatrix, renderTile.id);
- matrix::multiply(posMatrix, projMatrix, posMatrix);
+ const mat4& posMatrix = renderTile.matrix;
mat4 textLabelPlaneMatrix =
getLabelPlaneMatrix(posMatrix, pitchTextWithMap, rotateTextWithMap, state, pixelsToTileUnits);
@@ -212,8 +209,10 @@ void Placement::placeBucket(const SymbolBucket& bucket,
std::vector<ProjectedCollisionBox> textBoxes;
std::vector<ProjectedCollisionBox> iconBoxes;
- auto placeSymbol = [&] (const SymbolInstance& symbolInstance) {
- if (seenCrossTileIDs.count(symbolInstance.crossTileID) != 0u) return;
+ auto placeSymbol = [&](const SymbolInstance& symbolInstance) {
+ if (symbolInstance.crossTileID == SymbolInstance::invalidCrossTileID() ||
+ seenCrossTileIDs.count(symbolInstance.crossTileID) != 0u)
+ return;
if (renderTile.holdForFade()) {
// Mark all symbols from this tile as "not placed", but don't add to seenCrossTileIDs, because we don't