diff options
author | scroggo <scroggo@google.com> | 2016-01-19 07:53:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-19 07:53:39 -0800 |
commit | a913275bda105fd545af471b724d7e8c1dacb9ae (patch) | |
tree | a199c0c8ed2a9c337167ddd726d7a8e775a36f35 /src/core/SkStreamPriv.h | |
parent | a6bf4c54aaa3c1d1ae33f43af96a294c65bbd8fc (diff) |
SkStream/Priv cleanups
Replace all callers of SkCopyStreamToStorage with SkCopyStreamToData,
which is simpler and does the same thing.
Remove SkStreamRewindableFromSkStream, which is unused.
BUG=skia:4788
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1604963002
Review URL: https://codereview.chromium.org/1604963002
Diffstat (limited to 'src/core/SkStreamPriv.h')
-rw-r--r-- | src/core/SkStreamPriv.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/src/core/SkStreamPriv.h b/src/core/SkStreamPriv.h index b82f7d84e9..75f7cce8df 100644 --- a/src/core/SkStreamPriv.h +++ b/src/core/SkStreamPriv.h @@ -8,40 +8,22 @@ #ifndef SkStreamPriv_DEFINED #define SkStreamPriv_DEFINED -class SkAutoMalloc; -class SkStream; -class SkStreamRewindable; class SkData; - -/** - * Copy the provided stream to memory allocated by storage. - * Used by SkImageDecoder_libbmp and SkImageDecoder_libico. - * @param storage Allocator to hold the memory. Will be reset to be large - * enough to hold the entire stream. Upon successful return, - * storage->get() will point to data holding the SkStream's entire - * contents. - * @param stream SkStream to be copied into storage. - * @return size_t Total number of bytes in the SkStream, which is also the - * number of bytes pointed to by storage->get(). Returns 0 on failure. - */ -size_t SkCopyStreamToStorage(SkAutoMalloc* storage, SkStream* stream); +class SkStream; +class SkWStream; /** * Copy the provided stream to an SkData variable. + * + * Note: Assumes the stream is at the beginning. If it has a length, + * but is not at the beginning, this call will fail (return NULL). + * * @param stream SkStream to be copied into data. * @return SkData* The resulting SkData after the copy. This data * will have a ref count of one upon return and belongs to the * caller. Returns nullptr on failure. */ -SkData *SkCopyStreamToData(SkStream* stream); - -/** - * Attempt to convert this stream to a StreamRewindable in the - * cheapest possible manner (calling duplicate() if possible, and - * otherwise allocating memory for a copy). The position of the - * input stream is left in an indeterminate state. - */ -SkStreamRewindable* SkStreamRewindableFromSkStream(SkStream* stream); +SkData* SkCopyStreamToData(SkStream* stream); /** * Copies the input stream from the current position to the end. |