Chromium Code Reviews

Unified Diff: include/core/SkImageDecoder.h

Issue 23477009: Change SkImageDecoders to take an SkStreamRewindable. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove accidental whitespace change Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | include/images/SkImageRef.h » ('j') | src/images/SkImageDecoder_libwebp.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
};
« no previous file with comments | « no previous file | include/images/SkImageRef.h » ('j') | src/images/SkImageDecoder_libwebp.cpp » ('J')

Powered by Google App Engine