diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-06-20 11:09:19 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-07-17 12:20:03 -0700 |
commit | 1d15ed64dcf78daa9459247127857513608c18ad (patch) | |
tree | 9ea07cfab134972c6b7f169b4153a881e9279fe6 /src/mbgl/style/sources/image_source_impl.cpp | |
parent | b69f8338bbd18573b2a2a4282c4736f257526d03 (diff) | |
download | qtlocation-mapboxgl-1d15ed64dcf78daa9459247127857513608c18ad.tar.gz |
[core] Use shared pointer to manage Image source raster data and speed up change detection
Diffstat (limited to 'src/mbgl/style/sources/image_source_impl.cpp')
-rw-r--r-- | src/mbgl/style/sources/image_source_impl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/style/sources/image_source_impl.cpp b/src/mbgl/style/sources/image_source_impl.cpp index 98f3cc9db9..eb3e2635e5 100644 --- a/src/mbgl/style/sources/image_source_impl.cpp +++ b/src/mbgl/style/sources/image_source_impl.cpp @@ -12,17 +12,17 @@ ImageSource::Impl::Impl(std::string id_, std::array<LatLng, 4> coords_) ImageSource::Impl::Impl(const Impl& other, std::array<LatLng, 4> coords_) : Source::Impl(other), coords(std::move(coords_)), - image(other.image.clone()) { + image(other.image) { } -ImageSource::Impl::Impl(const Impl& rhs, UnassociatedImage image_) +ImageSource::Impl::Impl(const Impl& rhs, UnassociatedImage&& image_) : Source::Impl(rhs), coords(rhs.coords), - image(std::move(image_)) { + image(std::make_shared<UnassociatedImage>(std::move(image_))) { } ImageSource::Impl::~Impl() = default; -const UnassociatedImage& ImageSource::Impl::getImage() const { +std::shared_ptr<UnassociatedImage> ImageSource::Impl::getImage() const { return image; } |