Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: src/images/SkImageDecoder_libbmp.cpp

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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/images/SkImageDecoder_libbmp.cpp
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp
index 73e7a2014459417e713673e5ab64a55726153bbf..efe42b61beaa46751dc75dbdf0b04a966f236708 100644
--- a/src/images/SkImageDecoder_libbmp.cpp
+++ b/src/images/SkImageDecoder_libbmp.cpp
@@ -25,7 +25,7 @@ public:
}
protected:
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE;
+ virtual bool onDecode(SkStreamRewindable* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE;
private:
typedef SkImageDecoder INHERITED;
@@ -35,7 +35,7 @@ private:
DEFINE_DECODER_CREATOR(BMPImageDecoder);
///////////////////////////////////////////////////////////////////////////////
-static bool is_bmp(SkStream* stream) {
+static bool is_bmp(SkStreamRewindable* stream) {
static const char kBmpMagic[] = { 'B', 'M' };
@@ -45,23 +45,23 @@ static bool is_bmp(SkStream* stream) {
!memcmp(buffer, kBmpMagic, sizeof(kBmpMagic));
}
-static SkImageDecoder* sk_libbmp_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_libbmp_dfactory(SkStreamRewindable* stream) {
if (is_bmp(stream)) {
return SkNEW(SkBMPImageDecoder);
}
return NULL;
}
-static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_libbmp_dfactory);
+static SkTRegistry<SkImageDecoder*, SkStreamRewindable*> gReg(sk_libbmp_dfactory);
-static SkImageDecoder::Format get_format_bmp(SkStream* stream) {
+static SkImageDecoder::Format get_format_bmp(SkStreamRewindable* stream) {
if (is_bmp(stream)) {
return SkImageDecoder::kBMP_Format;
}
return SkImageDecoder::kUnknown_Format;
}
-static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_bmp);
+static SkTRegistry<SkImageDecoder::Format, SkStreamRewindable*> gFormatReg(get_format_bmp);
///////////////////////////////////////////////////////////////////////////////
@@ -93,7 +93,7 @@ private:
bool fJustBounds;
};
-bool SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
+bool SkBMPImageDecoder::onDecode(SkStreamRewindable* stream, SkBitmap* bm, Mode mode) {
// First read the entire stream, so that all of the data can be passed to
// the BmpDecoderHelper.

Powered by Google App Engine
This is Rietveld 408576698