aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkPngCodec.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-01-27 18:26:31 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-27 18:26:31 -0800
commit62358e77c2b8f31c59db0a0179bfed8feaa41929 (patch)
tree121234c6f12af57490b9fcc59ba3323209da0da4 /src/codec/SkPngCodec.cpp
parent1c971faab7b201dfcd71b2d684c79b6aa5c2fafd (diff)
SkPngFilters: guard with libpng >= 1.5.7
The read_filter array was added in libpng-1.5.7. No point to these filter methods if we can't plug them into libpng. TBR=msarett@google.com NOTRY=true NOPRESUBMIT=true BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1640933004 Review URL: https://codereview.chromium.org/1640933004
Diffstat (limited to 'src/codec/SkPngCodec.cpp')
-rw-r--r--src/codec/SkPngCodec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 9691f12d4d..155cbacf4d 100644
--- a/src/codec/SkPngCodec.cpp
+++ b/src/codec/SkPngCodec.cpp
@@ -17,7 +17,8 @@
#include "SkSwizzler.h"
#include "SkTemplates.h"
-#if defined(__SSE2__)
+// png_struct::read_filter[] was added in libpng 1.5.7.
+#if defined(__SSE2__) && PNG_LIBPNG_VER >= 10507
#include "pngstruct.h"
extern "C" void sk_png_init_filter_functions_sse2(png_structp png, unsigned int bpp) {