Fix AnimatedImageDrawable drawn in software

Test: Manual, existing CTS, I4e884636801c0a2e920ca9d99f3c38fb034b3774

- Fix a bug where the animation never advanced.
- Rename mFinished to mStarting. It was already being used to indicate
that we were restarting anyway. Now only set it to true in calls to
start().
- Prevent skipping ahead the same way we do in hardware.
- Return kFinished when reaching the last frame of the animation.

This also includes a fix for hardware drawing. The first time start() is
called, there is no need to create a snapshot of the first frame. Just
draw the first frame directly and kick off a decode of the second frame.

Change-Id: I0a6fb909a361dd4c233cfa2d79bc2210d2dcddc8
2 files changed