Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Issue 1703293002: Remove position from FrontBufferedStream (Closed)

Created:
4 years, 10 months ago by scroggo
Modified:
4 years, 10 months ago
Reviewers:
msarett, bungeman-skia
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 Committed: https://skia.googlesource.com/skia/+/ef0fed3bf06de231b66be5f5279468afd01e6f75

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix test_peeking_front_buffered_stream #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -16 lines) Patch
M src/utils/SkFrontBufferedStream.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M tests/CodexTest.cpp View 4 chunks +13 lines, -2 lines 0 comments Download
M tests/FrontBufferedStreamTest.cpp View 5 chunks +6 lines, -7 lines 0 comments Download
M tests/StreamTest.cpp View 1 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (8 generated)
scroggo
https://codereview.chromium.org/1703293002/diff/1/tests/CodexTest.cpp File tests/CodexTest.cpp (right): https://codereview.chromium.org/1703293002/diff/1/tests/CodexTest.cpp#newcode328 tests/CodexTest.cpp:328: // Test using SkFrontBufferedStream, as Android does Should've had ...
4 years, 10 months ago (2016-02-17 23:09:20 UTC) #3
scroggo
4 years, 10 months ago (2016-02-17 23:10:06 UTC) #5
bungeman-skia
lgtm
4 years, 10 months ago (2016-02-17 23:44:43 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1703293002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1703293002/1
4 years, 10 months ago (2016-02-17 23:44:45 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot/builds/6242)
4 years, 10 months ago (2016-02-17 23:54:59 UTC) #10
bungeman-skia
On 2016/02/17 23:54:59, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
4 years, 10 months ago (2016-02-18 00:12:17 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1703293002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1703293002/20001
4 years, 10 months ago (2016-02-18 13:32:31 UTC) #14
scroggo
On 2016/02/18 00:12:17, bungeman1 wrote: > On 2016/02/17 23:54:59, commit-bot: I haz the power wrote: ...
4 years, 10 months ago (2016-02-18 13:42:44 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/ef0fed3bf06de231b66be5f5279468afd01e6f75
4 years, 10 months ago (2016-02-18 13:59:32 UTC) #17
bungeman-skia
4 years, 10 months ago (2016-02-18 13:59:34 UTC) #18
Message was sent while issue was closed.
On 2016/02/18 13:42:44, scroggo wrote:
> On 2016/02/18 00:12:17, bungeman1 wrote:
> > On 2016/02/17 23:54:59, commit-bot: I haz the power wrote:
> > > Dry run: Try jobs failed on following builders:
> > >   Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia
> > > (JOB_FAILED,
> > >
> >
>
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2...)
> > 
> > Hmmmm... looks like test_peeking_front_buffered_stream was using the
position
> to
> > test things.
> 
> FrontBufferedStreamTest also used the position to test things, but some simple
> changes allowed us to work around that while still effectively testing the
> FrontBufferedStream. Patch set 2 fixes the StreamTest in the same way (stop
> calling FrontBufferedStream::getPosition()).
> 
> > Do we need a 'canSeek' method? I think the original intent was that
> > if the subclass of SkStream could not seek, then there wasn't any point in
> > determining what the position is (maybe there is, but it doesn't seem
common,
> > just this test right?).
> 
> 'canSeek' might be interesting, although the fact that we are only using
> getPosition without expecting to seek in tests is a sign that we probably
don't
> need to use it that way.
> 
> > Was the issue just that SkRawCodec assumed that seeking
> > couldn't fail if hasPosition() returned true? Or was it that it wants to
know
> up
> > front if it's 'seekable' or not and code paths diverge at some point?
> 
> The latter. SkRawCodec needs a seekable stream. So if it's not seekable, it
will
> buffer the whole thing. But if it is seekable, we want to avoid all that
> buffering.

sgtm, still lgtm

Powered by Google App Engine
This is Rietveld 408576698