History log of /external/skia/src/utils/SkFrontBufferedStream.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
145dbcd165d9d27298eb8888bc240e2d06a95464 03-Nov-2016 Ben Wagner <bungeman@google.com> Remove SkAutoTDelete.

Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/utils/SkFrontBufferedStream.cpp
18300a3aa7cb6eb55d21bb0450dffa58b6fc062c 16-Mar-2016 mtklein <mtklein@chromium.org> detach -> release

The C++ standard library uses the name "release" for the operation we call "detach".

Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).

This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".

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

Review URL: https://codereview.chromium.org/1809733002
/external/skia/src/utils/SkFrontBufferedStream.cpp
ef0fed3bf06de231b66be5f5279468afd01e6f75 18-Feb-2016 scroggo <scroggo@google.com> 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
/external/skia/src/utils/SkFrontBufferedStream.cpp
d61c384342aaf7facf31b948db98acc32d81d21b 07-Dec-2015 scroggo <scroggo@google.com> Allow SkStream::peek() to partially succeed

If the stream can peek less than requested, peek that amount. Return
the number of bytes peeked.

This simplifies crrev.com/1472123002. For a stream that is smaller than
14 bytes, it can successfully peek, meaning the client will not need to
fall back to read() + rewind(), which may fail if the stream can peek
but not rewind.

This CL revives code from patch set 3 of crrev.com/1044953002, where I
initially introduced peek() (including tests).

Add a test for SkFrontBufferedStream that verifies that peeking does
not make rewind() fail (i.e. by reading past the internal buffer).

BUG=skia:3257

Review URL: https://codereview.chromium.org/1490923005
/external/skia/src/utils/SkFrontBufferedStream.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/utils/SkFrontBufferedStream.cpp
385fe4d4b62d7d1dd76116dd570df3290a2f487b 26-Aug-2015 halcanary <halcanary@google.com> Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
/external/skia/src/utils/SkFrontBufferedStream.cpp
028a4135aa6404ccd3a494813befe6e1a35e5e6c 02-Apr-2015 scroggo <scroggo@google.com> Add a method to read a stream without advancing it.

Add a virtual method on SkStream which will do a "peek" some bytes, so
that those bytes are read, but the next call to read will be
unaffected.

Implement peek for SkMemoryStream, where the implementation is simple
and obvious.

Implement peek on SkFrontBufferedStream.

Add tests.

Motivated by decoding streams which cannot be rewound.

TBR=reed@google.com

BUG=skia:3257

Review URL: https://codereview.chromium.org/1044953002
/external/skia/src/utils/SkFrontBufferedStream.cpp
36352bf5e38f45a70ee4f4fc132a38048d38206d 26-Mar-2015 mtklein <mtklein@chromium.org> C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}

NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
/external/skia/src/utils/SkFrontBufferedStream.cpp
a1193e4b0e34a7e4e1bd33e9708d7341679f8321 21-Jan-2015 scroggo <scroggo@google.com> Make SkStream *not* ref counted.

SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
/external/skia/src/utils/SkFrontBufferedStream.cpp
72c9faab45124e08c85f70ca38536914862d947c 09-Jan-2015 mtklein <mtklein@chromium.org> Fix up all the easy virtual ... SK_OVERRIDE cases.

This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases. We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
/external/skia/src/utils/SkFrontBufferedStream.cpp
dd5a1e094c19fa10202c37c50a1f799e5af5dac0 21-Oct-2014 scroggo <scroggo@google.com> Check SkStream::isAtEnd before attempting to read.

In FrontBufferedStream, when attempting to read and buffer more
data, do not try to read if the underlying stream is at the end.

Prevents a bug where we continue trying to read a stream that
has nothing more to read.

Review URL: https://codereview.chromium.org/665303002
/external/skia/src/utils/SkFrontBufferedStream.cpp
1f66e4539177297545270ff3cbd1d8fa6c3481ac 21-Oct-2014 mtklein <mtklein@chromium.org> Add an assert that we still have a buffer to readFromBuffer().

sk_free(fBuffer.detach()) means fBuffer will be left as NULL, not a zero-length malloc.

BUG=skia:

Review URL: https://codereview.chromium.org/669813002
/external/skia/src/utils/SkFrontBufferedStream.cpp
74b88b70b8f78e09d223e3f8357e18e6043fa3aa 10-Feb-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow buffered stream to work with an offset.

If the stream being buffered is buffered from somewhere other than
the start, the SkFrontBufferedStream needs to take that into account
when reporting its length.

R=djsollen@google.com, bungeman@google.com, reed@google.com

Author: scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13388 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/utils/SkFrontBufferedStream.cpp
09a5383adc59c3798f6f6e851f46320393b6c4b8 12-Nov-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Hide implementation details: SkFrontBufferedStream

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12256 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/utils/SkFrontBufferedStream.cpp
fd67f2f0a394b4a795f1a0f64c5b1233938839a9 26-Sep-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix a warning.

git-svn-id: http://skia.googlecode.com/svn/trunk@11489 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/utils/SkFrontBufferedStream.cpp
83fd2c7c43fea7ea49adc68681e9ed3ed180d568 26-Sep-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add a buffered SkStream class.

This is used by Android to buffer an input stream which may not
otherwise be able to rewind.

Add a test for the new class.

R=bungeman@google.com, mtklein@google.com, reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11488 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/utils/SkFrontBufferedStream.cpp