diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-07-29 10:02:56 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-08-04 14:08:20 +0200 |
commit | 19e5d9af22cc76f4d3a1e911b1b6fabd352284eb (patch) | |
tree | 61aa75ae765d2ef3a54c93ff6f9b1e31b1812147 /platform | |
parent | daaa643bbf925e8f6f40649bba7b4c93911a1725 (diff) | |
download | qtlocation-mapboxgl-19e5d9af22cc76f4d3a1e911b1b6fabd352284eb.tar.gz |
don't require PNG_ALPHA_PREMULTIPLIED to support older versions of libpng
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/png_reader.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp index 4f8596a7b0..42b6946096 100644 --- a/platform/default/png_reader.cpp +++ b/platform/default/png_reader.cpp @@ -157,7 +157,12 @@ void PngReader<T>::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char * double gamma; if (png_get_gAMA(png_ptr, info_ptr, &gamma)) png_set_gamma(png_ptr, 2.2, gamma); + +#ifdef PNG_ALPHA_PREMULTIPLIED png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, PNG_GAMMA_LINEAR); +#else + // TODO: Manually premultiply the image data. +#endif if (x0 == 0 && y0 == 0 && w >= width_ && h >= height_) { |