diff options
author | scroggo <scroggo@google.com> | 2015-03-26 10:07:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-26 10:07:56 -0700 |
commit | 0eed6df064e6d148ddc330531d584ddd1bd4e6db (patch) | |
tree | 3a177b99898e1b8f29e014e3a1bdb3d970cf16dd | |
parent | 55011038816a3fc7f0c0a39d482fb85347cc2e78 (diff) |
Silence PNG warnings from SkPngCodec.
Review URL: https://codereview.chromium.org/1009633005
-rw-r--r-- | src/codec/SkCodec_libpng.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp index 8f2bdd35a0..4850235c07 100644 --- a/src/codec/SkCodec_libpng.cpp +++ b/src/codec/SkCodec_libpng.cpp @@ -50,6 +50,10 @@ static void sk_error_fn(png_structp png_ptr, png_const_charp msg) { longjmp(png_jmpbuf(png_ptr), 1); } +void sk_warning_fn(png_structp, png_const_charp msg) { + SkCodecPrintf("----- png warning %s\n", msg); +} + static void sk_read_fn(png_structp png_ptr, png_bytep data, png_size_t length) { SkStream* stream = static_cast<SkStream*>(png_get_io_ptr(png_ptr)); @@ -199,9 +203,8 @@ bool SkPngCodec::IsPng(SkStream* stream) { SkCodec* SkPngCodec::NewFromStream(SkStream* stream) { // The image is known to be a PNG. Decode enough to know the SkImageInfo. - // FIXME: Allow silencing warnings. png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, - sk_error_fn, NULL); + sk_error_fn, sk_warning_fn); if (!png_ptr) { return NULL; } |