summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-01-15 17:39:08 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-01-19 18:23:21 -0800
commitd34f8eb674b9753c47616f37ae88ff7a02f61ba0 (patch)
treec19cfd5ba6b68c229b6e395f9a62294ab33d46f9 /test/fixtures
parent26faa6a5ade54c0a423aab84106876dc59be868f (diff)
downloadqtlocation-mapboxgl-d34f8eb674b9753c47616f37ae88ff7a02f61ba0.tar.gz
[core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from SpriteImage( uint16_t width, uint16_t height, float pixelRatio, std::string&& data, bool sdf = false); to SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/util.cpp5
-rw-r--r--test/fixtures/util.hpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/test/fixtures/util.cpp b/test/fixtures/util.cpp
index 926e267631..c2a5d83637 100644
--- a/test/fixtures/util.cpp
+++ b/test/fixtures/util.cpp
@@ -89,6 +89,7 @@ Server::~Server() {
}
}
+
// from https://gist.github.com/ArtemGr/997887
uint64_t crc64(const char* data, size_t size) {
boost::crc_optimal<64, 0x04C11DB7, 0, 0, false, false> crc;
@@ -100,6 +101,10 @@ uint64_t crc64(const std::string& str) {
return crc64(str.data(), str.size());
}
+uint64_t crc64(const PremultipliedImage &image) {
+ return crc64(reinterpret_cast<const char*>(image.data.get()), image.size());
+}
+
PremultipliedImage render(Map& map, std::chrono::milliseconds timeout) {
std::promise<PremultipliedImage> promise;
map.renderStill([&](std::exception_ptr, PremultipliedImage&& image) {
diff --git a/test/fixtures/util.hpp b/test/fixtures/util.hpp
index d7c9c63a89..7a240cb41f 100644
--- a/test/fixtures/util.hpp
+++ b/test/fixtures/util.hpp
@@ -33,6 +33,7 @@ private:
uint64_t crc64(const char*, size_t);
uint64_t crc64(const std::string&);
+uint64_t crc64(const PremultipliedImage&);
PremultipliedImage render(Map&,
std::chrono::milliseconds timeout = std::chrono::milliseconds(1000));