diff options
author | 2013-09-25 21:34:24 +0000 | |
---|---|---|
committer | 2013-09-25 21:34:24 +0000 | |
commit | b5571b3324cf18629a255ec85e189447069c9b14 (patch) | |
tree | c870a12922f0bd59e69f06848672359e4c825d71 /src/images/SkImageDecoder_libwebp.cpp | |
parent | 228f2b8887ab63532cbe0b7b64e66c133f45d45a (diff) |
Change SkImageDecoders to take an SkStreamRewindable.
Only affects factories, static functions that will use the factories,
and subset decoding, which all require rewinding. The decoders
themselves continue to take an SkStream. This is merely documentation
stating which functions will possibly rewind the passed in SkStream.
This is part of the general change to coordinate SkStreams with
Android's streams, which don't necessarily support rewinding in all
cases.
Update callers to use SkStreamRewindable.
BUG=skia:1572
R=bungeman@google.com, reed@google.com
Review URL: https://codereview.chromium.org/23477009
git-svn-id: http://skia.googlecode.com/svn/trunk@11460 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/images/SkImageDecoder_libwebp.cpp')
-rw-r--r-- | src/images/SkImageDecoder_libwebp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp index a6a6991511..625e96e42b 100644 --- a/src/images/SkImageDecoder_libwebp.cpp +++ b/src/images/SkImageDecoder_libwebp.cpp @@ -110,7 +110,7 @@ public: } protected: - virtual bool onBuildTileIndex(SkStream *stream, int *width, int *height) SK_OVERRIDE; + virtual bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) SK_OVERRIDE; virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) SK_OVERRIDE; virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; @@ -300,7 +300,7 @@ bool SkWEBPImageDecoder::setDecodeConfig(SkBitmap* decodedBitmap, return true; } -bool SkWEBPImageDecoder::onBuildTileIndex(SkStream* stream, +bool SkWEBPImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width, int *height) { int origWidth, origHeight, hasAlpha; if (!webp_parse_header(stream, &origWidth, &origHeight, &hasAlpha)) { @@ -575,7 +575,7 @@ DEFINE_DECODER_CREATOR(WEBPImageDecoder); DEFINE_ENCODER_CREATOR(WEBPImageEncoder); /////////////////////////////////////////////////////////////////////////////// -static SkImageDecoder* sk_libwebp_dfactory(SkStream* stream) { +static SkImageDecoder* sk_libwebp_dfactory(SkStreamRewindable* stream) { int width, height, hasAlpha; if (!webp_parse_header(stream, &width, &height, &hasAlpha)) { return NULL; @@ -585,7 +585,7 @@ static SkImageDecoder* sk_libwebp_dfactory(SkStream* stream) { return SkNEW(SkWEBPImageDecoder); } -static SkImageDecoder::Format get_format_webp(SkStream* stream) { +static SkImageDecoder::Format get_format_webp(SkStreamRewindable* stream) { int width, height, hasAlpha; if (webp_parse_header(stream, &width, &height, &hasAlpha)) { return SkImageDecoder::kWEBP_Format; |