diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-02 09:54:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 09:54:06 -0700 |
commit | 5c52401d5504ab4b84d1510042c6b97504c50933 (patch) | |
tree | 3bd2feb4e985f5402ec0fc112aab6717426d46aa /include | |
parent | 3f0c89d633a5056006557ad5f4b9e446807d00ee (diff) | |
download | qtlocation-mapboxgl-5c52401d5504ab4b84d1510042c6b97504c50933.tar.gz |
[core] Make Map.addImage tests pass (#8843)
Fix Node tests suite implementation to parse pixelRatio from style json
Premultiply images in the node binding before sending to mbgl core
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/util/image.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/util/premultiply.hpp | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp index c019bb949c..a41b8462bd 100644 --- a/include/mbgl/util/image.hpp +++ b/include/mbgl/util/image.hpp @@ -40,11 +40,14 @@ public: Image(Image&& o) : size(o.size), - data(std::move(o.data)) {} + data(std::move(o.data)) { + o.size.width = o.size.height = 0; + } Image& operator=(Image&& o) { size = o.size; data = std::move(o.data); + o.size.width = o.size.height = 0; return *this; } diff --git a/include/mbgl/util/premultiply.hpp b/include/mbgl/util/premultiply.hpp new file mode 100644 index 0000000000..532c7cb11d --- /dev/null +++ b/include/mbgl/util/premultiply.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include <mbgl/util/image.hpp> + +namespace mbgl { +namespace util { + +PremultipliedImage premultiply(UnassociatedImage&&); +UnassociatedImage unpremultiply(PremultipliedImage&&); + +} // namespace util +} // namespace mbgl |