summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-06-06 09:01:17 -0700
committerAnsis Brammanis <brammanis@gmail.com>2017-07-11 09:10:24 -0700
commita0e37fe35b1af9f607600d2e792e2ff56796af6e (patch)
tree7eeb62248da1159d8d800b3dbeb4cd935703e458 /src/mbgl/tile
parenta432a289a35815beeadc8719a963f50f8dc07bbb (diff)
downloadqtlocation-mapboxgl-a0e37fe35b1af9f607600d2e792e2ff56796af6e.tar.gz
[core] Hold on to tile yStretch value for rendering old symbolBuckets while waiting for new ones.
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/geometry_tile.cpp11
-rw-r--r--src/mbgl/tile/geometry_tile.hpp1
2 files changed, 10 insertions, 2 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index ad5c2edd4c..1ee303b50f 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -42,7 +42,8 @@ GeometryTile::GeometryTile(const OverscaledTileID& id_,
parameters.pixelRatio),
glyphManager(parameters.glyphManager),
imageManager(parameters.imageManager),
- placementThrottler(Milliseconds(300), [this] { invokePlacement(); }) {
+ placementThrottler(Milliseconds(300), [this] { invokePlacement(); }),
+ lastYStretch(1.0f) {
}
GeometryTile::~GeometryTile() {
@@ -143,6 +144,9 @@ void GeometryTile::onPlacement(PlacementResult result) {
if (result.iconAtlasImage) {
iconAtlasImage = std::move(*result.iconAtlasImage);
}
+ if (collisionTile.get()) {
+ lastYStretch = collisionTile->yStretch;
+ }
observer->onTileChanged(*this);
}
@@ -265,7 +269,10 @@ void GeometryTile::querySourceFeatures(
}
float GeometryTile::yStretch() const {
- return collisionTile->yStretch;
+ // collisionTile gets reset in onLayout but we don't clear the symbolBuckets
+ // until a new placement result comes along, so keep the yStretch value in
+ // case we need to render them.
+ return lastYStretch;
}
} // namespace mbgl
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 3e2efe1093..943296e01b 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -122,6 +122,7 @@ private:
std::unique_ptr<CollisionTile> collisionTile;
util::Throttler placementThrottler;
+ float lastYStretch;
public:
optional<gl::Texture> glyphAtlasTexture;