summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-05-02 09:54:06 -0700
committerGitHub <noreply@github.com>2017-05-02 09:54:06 -0700
commit5c52401d5504ab4b84d1510042c6b97504c50933 (patch)
tree3bd2feb4e985f5402ec0fc112aab6717426d46aa /include/mbgl
parent3f0c89d633a5056006557ad5f4b9e446807d00ee (diff)
downloadqtlocation-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/mbgl')
-rw-r--r--include/mbgl/util/image.hpp5
-rw-r--r--include/mbgl/util/premultiply.hpp12
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