diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-19 13:32:22 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-19 13:34:56 -0800 |
commit | 6709bdcacd5a45a10b554f3f225206c9494e5e43 (patch) | |
tree | 0117df5dcf6eadad1d6b6c5208b41a782e46258b /platform | |
parent | 2010fbb0e61cbe7c0b08560118ca887fc1d7193e (diff) | |
download | qtlocation-mapboxgl-6709bdcacd5a45a10b554f3f225206c9494e5e43.tar.gz |
Revert WebP support due to broken builds
This reverts commits 2010fbb0e61cbe7c0b08560118ca887fc1d7193e, a361ce47a19d37b96b48cd605c62c5ab79bba462, and d004bb275ae3ea60bb6c2febd6fa22f1f51c3993.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/image.cpp | 20 | ||||
-rw-r--r-- | platform/default/webp_reader.cpp | 27 | ||||
-rw-r--r-- | platform/linux/scripts/configure.sh | 1 |
3 files changed, 3 insertions, 45 deletions
diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 71fb5414b3..bf8071af5c 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -70,10 +70,6 @@ std::string encodePNG(const PremultipliedImage& pre) { return result; } -#if !defined(__ANDROID__) && !defined(__APPLE__) -PremultipliedImage decodeWebP(const uint8_t*, size_t); -#endif // !defined(__ANDROID__) && !defined(__APPLE__) - PremultipliedImage decodePNG(const uint8_t*, size_t); PremultipliedImage decodeJPEG(const uint8_t*, size_t); @@ -81,26 +77,16 @@ PremultipliedImage decodeImage(const std::string& string) { const uint8_t* data = reinterpret_cast<const uint8_t*>(string.data()); const size_t size = string.size(); -#if !defined(__ANDROID__) && !defined(__APPLE__) - if (size >= 12) { - uint32_t riff_magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - uint32_t webp_magic = (data[8] << 24) | (data[9] << 16) | (data[10] << 8) | data[11]; - if (riff_magic == 0x52494646 && webp_magic == 0x57454250) { - return decodeWebP(data, size); - } - } -#endif // !defined(__ANDROID__) && !defined(__APPLE__) - if (size >= 4) { - uint32_t magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; + unsigned int magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; if (magic == 0x89504E47U) { return decodePNG(data, size); } } if (size >= 2) { - uint16_t magic = ((data[0] << 8) | data[1]) & 0xffff; - if (magic == 0xFFD8) { + unsigned int magic = ((data[0] << 8) | data[1]) & 0xffff; + if (magic == 0xffd8) { return decodeJPEG(data, size); } } diff --git a/platform/default/webp_reader.cpp b/platform/default/webp_reader.cpp deleted file mode 100644 index 37d23da110..0000000000 --- a/platform/default/webp_reader.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include <mbgl/util/image.hpp> -#include <mbgl/util/premultiply.hpp> -#include <mbgl/platform/log.hpp> - -extern "C" -{ -#include <webp/decode.h> -} - -namespace mbgl { - -PremultipliedImage decodeWebP(const uint8_t* data, size_t size) { - int width = 0, height = 0; - if (WebPGetInfo(data, size, &width, &height) == 0) { - throw std::runtime_error("failed to retrieve WebP basic header information"); - } - - std::unique_ptr<uint8_t[]> webp(WebPDecodeRGBA(data, size, &width, &height)); - if (!webp) { - throw std::runtime_error("failed to decode WebP data"); - } - - UnassociatedImage image { size_t(width), size_t(height), std::move(webp) }; - return util::premultiply(std::move(image)); -} - -} // namespace mbgl diff --git a/platform/linux/scripts/configure.sh b/platform/linux/scripts/configure.sh index 8510d83bdc..e824376804 100644 --- a/platform/linux/scripts/configure.sh +++ b/platform/linux/scripts/configure.sh @@ -15,7 +15,6 @@ VARIANT_VERSION=1.0 RAPIDJSON_VERSION=1.0.2 GTEST_VERSION=1.7.0 PIXELMATCH_VERSION=0.9.0 -WEBP_VERSION=0.5.0 function print_opengl_flags { CONFIG+=" 'opengl_cflags%': $(quote_flags $(pkg-config gl x11 --cflags)),"$LN |