diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-07-11 14:31:05 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-07-17 12:20:03 -0700 |
commit | 8ae70105463db78699ef3743fb24503ed8feb054 (patch) | |
tree | e5a8479f22d1beb097f43bd4e36922d2cf4bd56e /src/mbgl/style/sources/image_source.cpp | |
parent | 1d15ed64dcf78daa9459247127857513608c18ad (diff) | |
download | qtlocation-mapboxgl-8ae70105463db78699ef3743fb24503ed8feb054.tar.gz |
[core][ios][android][macos] Use premultiplied image directly for RasterTile and ImageSource, un-premultiply in the shader for blending
Diffstat (limited to 'src/mbgl/style/sources/image_source.cpp')
-rw-r--r-- | src/mbgl/style/sources/image_source.cpp | 5 |
1 files changed, 2 insertions, 3 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()); } |