| Index: include/core/SkImageDecoder.h
|
| diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
|
| index 7bdaaa8eb5f072b26eb7faf63d32fe493b5ff926..35bfdd0493ba2e60d22555abee0a735a552e139a 100644
|
| --- a/include/core/SkImageDecoder.h
|
| +++ b/include/core/SkImageDecoder.h
|
| @@ -17,7 +17,7 @@
|
| #include "SkRefCnt.h"
|
| #include "SkTypes.h"
|
|
|
| -class SkStream;
|
| +class SkStreamRewindable;
|
|
|
| /** \class SkImageDecoder
|
|
|
| @@ -45,10 +45,10 @@ public:
|
| */
|
| virtual Format getFormat() const;
|
|
|
| - /** Return the format of the SkStream or kUnknown_Format if it cannot be determined. Rewinds the
|
| - stream before returning.
|
| + /** Return the format of the SkStreamRewindable or kUnknown_Format if it cannot be determined.
|
| + Rewinds the stream before returning.
|
| */
|
| - static Format GetStreamFormat(SkStream*);
|
| + static Format GetStreamFormat(SkStreamRewindable*);
|
|
|
| /** Return a readable string of the Format provided.
|
| */
|
| @@ -277,8 +277,8 @@ public:
|
| If a Chooser is installed via setChooser, it may be used to select
|
| which image to return from a format that contains multiple images.
|
| */
|
| - bool decode(SkStream*, SkBitmap* bitmap, SkBitmap::Config pref, Mode);
|
| - bool decode(SkStream* stream, SkBitmap* bitmap, Mode mode) {
|
| + bool decode(SkStreamRewindable*, SkBitmap* bitmap, SkBitmap::Config pref, Mode);
|
| + bool decode(SkStreamRewindable* stream, SkBitmap* bitmap, Mode mode) {
|
| return this->decode(stream, bitmap, SkBitmap::kNo_Config, mode);
|
| }
|
|
|
| @@ -289,7 +289,7 @@ public:
|
| *
|
| * Return true for success or false on failure.
|
| */
|
| - bool buildTileIndex(SkStream*, int *width, int *height);
|
| + bool buildTileIndex(SkStreamRewindable*, int *width, int *height);
|
|
|
| /**
|
| * Decode a rectangle subset in the image.
|
| @@ -311,7 +311,7 @@ public:
|
| /** Given a stream, this will try to find an appropriate decoder object.
|
| If none is found, the method returns NULL.
|
| */
|
| - static SkImageDecoder* Factory(SkStream*);
|
| + static SkImageDecoder* Factory(SkStreamRewindable*);
|
|
|
| /** Decode the image stored in the specified file, and store the result
|
| in bitmap. Return true for success or false on failure.
|
| @@ -373,7 +373,7 @@ public:
|
| static bool DecodeMemoryToTarget(const void* buffer, size_t size, SkImage::Info* info,
|
| const SkBitmapFactory::Target* target);
|
|
|
| - /** Decode the image stored in the specified SkStream, and store the result
|
| + /** Decode the image stored in the specified SkStreamRewindable, and store the result
|
| in bitmap. Return true for success or false on failure.
|
|
|
| @param prefConfig If the PrefConfigTable is not set, prefer this config.
|
| @@ -382,10 +382,10 @@ public:
|
| @param format On success, if format is non-null, it is set to the format
|
| of the decoded stream. On failure it is ignored.
|
| */
|
| - static bool DecodeStream(SkStream* stream, SkBitmap* bitmap,
|
| + static bool DecodeStream(SkStreamRewindable* stream, SkBitmap* bitmap,
|
| SkBitmap::Config prefConfig, Mode,
|
| Format* format = NULL);
|
| - static bool DecodeStream(SkStream* stream, SkBitmap* bitmap) {
|
| + static bool DecodeStream(SkStreamRewindable* stream, SkBitmap* bitmap) {
|
| return DecodeStream(stream, bitmap, SkBitmap::kNo_Config,
|
| kDecodePixels_Mode, NULL);
|
| }
|
| @@ -406,11 +406,11 @@ public:
|
|
|
| protected:
|
| // must be overridden in subclasses. This guy is called by decode(...)
|
| - virtual bool onDecode(SkStream*, SkBitmap* bitmap, Mode) = 0;
|
| + virtual bool onDecode(SkStreamRewindable*, SkBitmap* bitmap, Mode) = 0;
|
|
|
| // If the decoder wants to support tiled based decoding,
|
| // this method must be overridden. This guy is called by buildTileIndex(...)
|
| - virtual bool onBuildTileIndex(SkStream*, int *width, int *height) {
|
| + virtual bool onBuildTileIndex(SkStreamRewindable*, int *width, int *height) {
|
| return false;
|
| }
|
|
|
| @@ -521,7 +521,7 @@ class SkImageDecoderFactory : public SkRefCnt {
|
| public:
|
| SK_DECLARE_INST_COUNT(SkImageDecoderFactory)
|
|
|
| - virtual SkImageDecoder* newDecoder(SkStream*) = 0;
|
| + virtual SkImageDecoder* newDecoder(SkStreamRewindable*) = 0;
|
|
|
| private:
|
| typedef SkRefCnt INHERITED;
|
| @@ -530,7 +530,7 @@ private:
|
| class SkDefaultImageDecoderFactory : SkImageDecoderFactory {
|
| public:
|
| // calls SkImageDecoder::Factory(stream)
|
| - virtual SkImageDecoder* newDecoder(SkStream* stream) {
|
| + virtual SkImageDecoder* newDecoder(SkStreamRewindable* stream) {
|
| return SkImageDecoder::Factory(stream);
|
| }
|
| };
|
|
|