Make SkPngCodec support rewinding properly.
authorscroggo <scroggo@google.com>
Wed, 1 Apr 2015 16:33:23 +0000 (09:33 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 1 Apr 2015 16:33:23 +0000 (09:33 -0700)
commit3eada2a49ff2814833afcbd61329aa451d86da9c
tree2c9f70785c8c71060de9c3e8897af621397e3da5
parent57291dcc9525598a81c2b7aa01e41f3fe238ae19
Make SkPngCodec support rewinding properly.

Separate out the code for reading the header, and use it to reinitialize
fPng_ptr and fInfo_ptr after a rewind.

Use common code to clean up fPng_ptr and fInfo_ptr, and set them to
NULL and treat them as NULL as appropriate.

Update the test to expect SkPngCodec to succeed.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1048423003
src/codec/SkCodec_libpng.cpp
src/codec/SkCodec_libpng.h
tests/CodexTest.cpp