summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/sources/render_image_source.cpp
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-05-25 14:36:05 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-06-19 09:50:08 -0700
commitab5b310a9eb7c88935cc457da1af81349fbe8d41 (patch)
treee1485c8aa2f00e2b50daa0aa7f997ddda59c2562 /src/mbgl/renderer/sources/render_image_source.cpp
parent7b05606464ac4d57b59b64015629e9578cbebac2 (diff)
downloadqtlocation-mapboxgl-ab5b310a9eb7c88935cc457da1af81349fbe8d41.tar.gz
[iOS][macOS] Add ImageSource bindings
Diffstat (limited to 'src/mbgl/renderer/sources/render_image_source.cpp')
-rw-r--r--src/mbgl/renderer/sources/render_image_source.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp
index 7fb7caa580..f5068b9d7f 100644
--- a/src/mbgl/renderer/sources/render_image_source.cpp
+++ b/src/mbgl/renderer/sources/render_image_source.cpp
@@ -135,12 +135,13 @@ void RenderImageSource::update(Immutable<style::Source::Impl> baseImpl_,
geomCoords.push_back(gc);
}
- if (!bucket) {
- UnassociatedImage img = impl().getImage().clone();
- if (!img.valid()) {
- return;
- }
- bucket = std::make_unique<RasterBucket>(std::move(img));
+ const UnassociatedImage& image = impl().getImage();
+ if (!image.valid()) {
+ return;
+ }
+
+ if (!bucket || image != bucket->image) {
+ bucket = std::make_unique<RasterBucket>(image.clone());
} else {
bucket->clear();
}