Report first GIF frame after knowing its meta data

Previously, we reported the first image as soon as it was available. As
a result, in crrev.com/2565323003, InitializeNewFrame might be called
before the metadata is known, meaning it would read the wrong metadata.

Instead of looking at the imagesCount(), SkGifCodec::NewFromStream looks
at frameContext(0), which may still exist even if it's not yet counted
in imagesCount().

Add a test that confirms the desired behavior.

Change-Id: Ib392721ecd2218ba0fcd35aaa64117c0ba3e4ea6
Reviewed-on: https://skia-review.googlesource.com/24405
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
3 files changed