[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)
This commit is contained in:
5
test/fixtures/util.cpp
vendored
5
test/fixtures/util.cpp
vendored
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user