Remove position from FrontBufferedStream
authorscroggo <scroggo@google.com>
Thu, 18 Feb 2016 13:59:25 +0000 (05:59 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Feb 2016 13:59:25 +0000 (05:59 -0800)
commitef0fed3bf06de231b66be5f5279468afd01e6f75
tree6354bcd42067a865522af79c208aca2f907a3a8c
parent6b14c6b329fde5402ce7458d8261e80944279d06
Remove position from FrontBufferedStream

When FrontBufferedStream was written, it implemented getPosition()
and returned true for hasPosition(). The CL that introduced it
(crrev.com/23717055) does not have any indication why, but I'm guessing
it was because it was easy to implement. None of our decoders rely on
this (only some tests do).

Now that we have a decoder (SkRawCodec) that expects to be able to seek
a stream if it has a position (which makes sense - SkStream.h
associates that with SkStreamSeekable, and there is no other way to
check to see if a stream is seekable), it is failing because
FrontBufferedStream reports it has a position and the decoder tries to
seek.

Remove FrontBufferedStream::hasPosition() (reverting to the default,
false) and ::getPosition() (so it will return 0).

Fix tests - do not call FrontBufferedStream::getPosition()

Update CodexTest to test using an FrontBufferedStream, like Android
does.

BUG=b/27218441
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1703293002

Review URL: https://codereview.chromium.org/1703293002
src/utils/SkFrontBufferedStream.cpp
tests/CodexTest.cpp
tests/FrontBufferedStreamTest.cpp
tests/StreamTest.cpp