summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/sources')
-rw-r--r--src/mbgl/style/sources/image_source.cpp5
-rw-r--r--src/mbgl/style/sources/image_source_impl.cpp6
-rw-r--r--src/mbgl/style/sources/image_source_impl.hpp6
3 files changed, 8 insertions, 9 deletions
diff --git a/src/mbgl/style/sources/image_source.cpp b/src/mbgl/style/sources/image_source.cpp
index 9313d8da4a..9b60ba1a48 100644
--- a/src/mbgl/style/sources/image_source.cpp
+++ b/src/mbgl/style/sources/image_source.cpp
@@ -37,7 +37,7 @@ void ImageSource::setURL(const std::string& url_) {
}
}
-void ImageSource::setImage(UnassociatedImage&& image_) {
+void ImageSource::setImage(PremultipliedImage&& image_) {
url = {};
if (req) {
req.reset();
@@ -70,8 +70,7 @@ void ImageSource::loadDescription(FileSource& fileSource) {
observer->onSourceError(*this, std::make_exception_ptr(std::runtime_error("unexpectedly empty image url")));
} else {
try {
- UnassociatedImage image = util::unpremultiply(decodeImage(*res.data));
- baseImpl = makeMutable<Impl>(impl(), std::move(image));
+ baseImpl = makeMutable<Impl>(impl(), decodeImage(*res.data));
} catch (...) {
observer->onSourceError(*this, std::current_exception());
}
diff --git a/src/mbgl/style/sources/image_source_impl.cpp b/src/mbgl/style/sources/image_source_impl.cpp
index eb3e2635e5..c1f31dbdc6 100644
--- a/src/mbgl/style/sources/image_source_impl.cpp
+++ b/src/mbgl/style/sources/image_source_impl.cpp
@@ -15,14 +15,14 @@ ImageSource::Impl::Impl(const Impl& other, std::array<LatLng, 4> coords_)
image(other.image) {
}
-ImageSource::Impl::Impl(const Impl& rhs, UnassociatedImage&& image_)
+ImageSource::Impl::Impl(const Impl& rhs, PremultipliedImage&& image_)
: Source::Impl(rhs),
coords(rhs.coords),
- image(std::make_shared<UnassociatedImage>(std::move(image_))) {
+ image(std::make_shared<PremultipliedImage>(std::move(image_))) {
}
ImageSource::Impl::~Impl() = default;
-std::shared_ptr<UnassociatedImage> ImageSource::Impl::getImage() const {
+std::shared_ptr<PremultipliedImage> ImageSource::Impl::getImage() const {
return image;
}
diff --git a/src/mbgl/style/sources/image_source_impl.hpp b/src/mbgl/style/sources/image_source_impl.hpp
index e0999c34a5..1e1b005a32 100644
--- a/src/mbgl/style/sources/image_source_impl.hpp
+++ b/src/mbgl/style/sources/image_source_impl.hpp
@@ -13,17 +13,17 @@ class ImageSource::Impl : public Source::Impl {
public:
Impl(std::string id, std::array<LatLng, 4> coords);
Impl(const Impl& rhs, std::array<LatLng, 4> coords);
- Impl(const Impl& rhs, UnassociatedImage&& image);
+ Impl(const Impl& rhs, PremultipliedImage&& image);
~Impl() final;
- std::shared_ptr<UnassociatedImage> getImage() const;
+ std::shared_ptr<PremultipliedImage> getImage() const;
std::array<LatLng, 4> getCoordinates() const;
optional<std::string> getAttribution() const final;
private:
std::array<LatLng, 4> coords;
- std::shared_ptr<UnassociatedImage> image;
+ std::shared_ptr<PremultipliedImage> image;
};
} // namespace style