summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-13 11:07:38 -0400
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-13 22:17:41 +0300
commitcda418198f17df87962e1797e024714eaceadcd7 (patch)
treec4d0b9bd696ca3416be7888357afe09f62815b91 /src/mbgl
parent366a69785a2fffd0713897f53647cf18b7a0c645 (diff)
downloadqtlocation-mapboxgl-cda418198f17df87962e1797e024714eaceadcd7.tar.gz
[core] Clear atlasImage rect for a removed pattern
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/renderer/image_manager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/renderer/image_manager.cpp b/src/mbgl/renderer/image_manager.cpp
index 365a2742de..2ef6be0c4f 100644
--- a/src/mbgl/renderer/image_manager.cpp
+++ b/src/mbgl/renderer/image_manager.cpp
@@ -39,6 +39,13 @@ void ImageManager::removeImage(const std::string& id) {
auto it = patterns.find(id);
if (it != patterns.end()) {
+ // Clear pattern from the atlas image.
+ const uint32_t x = it->second.bin->x;
+ const uint32_t y = it->second.bin->y;
+ const uint32_t w = it->second.bin->w;
+ const uint32_t h = it->second.bin->h;
+ PremultipliedImage::clear(atlasImage, { x, y }, { w, h });
+
shelfPack.unref(*it->second.bin);
patterns.erase(it);
}