GIF: Only report a frame after knowing dependency
authorLeon Scroggins III <scroggo@google.com>
Mon, 30 Jan 2017 18:55:14 +0000 (13:55 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 30 Jan 2017 21:22:29 +0000 (21:22 +0000)
commite4ba1059ddf4d9a1e41b01c378f1a5cc15669343
treea4d1c0150ded54ab329110bdf71bcd22fcc031fb
parent2589042daf42efb56896a0653a9a1ce4f825dd53
GIF: Only report a frame after knowing dependency

Previously, getFrameInfo might report a frame that was truncated prior
to setting its requiredFrame. As a result, fRequiredFrame may be
different depending on how much data has already been received.

If there is a local color table, do not report the frame until the
color table has been received, since that is used to determine
fRequiredFrame. If there is no local color table, set fRequiredFrame
and report the frame after reading the header.

Add a test.

Replace make_from_resource with GetResourceAsData

Change-Id: I1b697f766c1d0e1e12ab2ae1d27167af5193395d
Reviewed-on: https://skia-review.googlesource.com/7756
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
src/codec/SkGifCodec.cpp
tests/CodecPartialTest.cpp
third_party/gif/SkGifImageReader.cpp
third_party/gif/SkGifImageReader.h