Checking if frame is complete and access duration doesn't need a decode

The goal of this change is to minimize image decoding on the main thread.

This change is to avoid image decoding for these two operations:
1. frameIsCompleteAtIndex
2. frameDurationAtIndex
These two operations are moved to ImageDecoder interface and are now const
to prevent future regression.

We are now able to check if a frame is complete by parsing the entire GIF file
without decoding. This also provides information like frame duration such that
controller the animation doesn't require any decoding.

This change is critical to moving animated image decoding off the main thread.

BUG=169377, 181321
TEST=(1) Unit test in GIFImageDecoderTest to test change in decoder behavior.
     (2) Image animation cannot be tested reliable via layout test and is
         tested manually with wikigifs.org.

Review URL: https://chromiumcodereview.appspot.com/14317005

git-svn-id: svn://svn.chromium.org/blink/trunk@149883 bbb929c8-8fbe-4397-9dbb-9b2b20218538
11 files changed