Read and write pixel offset when serializing bitmaps.
authorscroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 May 2013 14:39:54 +0000 (14:39 +0000)
committerscroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 May 2013 14:39:54 +0000 (14:39 +0000)
commit2d76d933ff8ba2090229599f32bdb2b17fb7ad50
treeab25cac01987bcb1646888ad68aa9433210f5f45
parentd5936923addb492f02e4b341a8d225d6215af0d0
Read and write pixel offset when serializing bitmaps.

Remove ifdef's preventing a change to read and write offsets.
This fixes a bug where the SKP will draw the wrong portion
of bitmaps.

In addition, read the offset from the stream whether the
bitmap decoder succeeds or not, so that a failure to decode
still advances the stream to the correct spot.

Set the offset to 0 before calling SkPicture::EncodeBitmap,
so that if the function does not set it, we will not
modify the offset.

REQUIRES A CHANGE TO THE PICTURE VERSION. Does not change
PICTURE_VERSION itself, since other CLs are also requiring
a change.

BUG=https://code.google.com/p/skia/issues/detail?id=1301
R=djsollen@google.com

Review URL: https://codereview.chromium.org/15713015

git-svn-id: http://skia.googlecode.com/svn/trunk@9368 2bbb7eff-a529-9590-31e7-b0007b416f81
src/core/SkOrderedReadBuffer.cpp
src/core/SkOrderedWriteBuffer.cpp