summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r--src/mbgl/style/style.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 1814ba8adb..902cc1687c 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -60,11 +60,10 @@ const Light* Style::getLight() const {
return impl->getLight();
}
-const PremultipliedImage* Style::getImage(const std::string& name) const {
- if (auto* image = impl->getImage(name)) {
- return &(image->image);
- }
- return nullptr;
+optional<Image> Style::getImage(const std::string& name) const {
+ auto image = impl->getImage(name);
+ if (!image) return nullopt;
+ return style::Image(std::move(*image));
}
void Style::addImage(std::unique_ptr<Image> image) {