aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-01-07 11:03:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-07 11:03:25 -0800
commit133eaaacdd23fb45db47a32e854eab3ecd76f213 (patch)
tree85db0d49c7704ab8c05201a6dd677b03e37bbcaf /src/codec
parentc7e211acd0c9201688de7ff0c9a2271c67440adf (diff)
Store ninepatch chunks in the png header in CodexTest
We are making a change in Android to store ninepatch chunks in the png header. Thus, our ninepatch test should match the Android framework's use. https://googleplex-android-review.git.corp.google.com/#/c/832067/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1553303003 Review URL: https://codereview.chromium.org/1553303003
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/SkCodec_libpng.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 3086a36599..6916ba7c39 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -259,8 +259,9 @@ static bool read_header(SkStream* stream, SkPngChunkReader* chunkReader,
png_set_read_fn(png_ptr, static_cast<void*>(stream), sk_read_fn);
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
- // FIXME: Does this need to be installed so early?
- // hookup our chunkReader so we can see any user-chunks the caller may be interested in
+ // Hookup our chunkReader so we can see any user-chunks the caller may be interested in.
+ // This needs to be installed before we read the png header. Android may store ninepatch
+ // chunks in the header.
if (chunkReader) {
png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_ALWAYS, (png_byte*)"", 0);
png_set_read_user_chunk_fn(png_ptr, (png_voidp) chunkReader, sk_read_user_chunk);