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

Unified Diff: src/images/SkImageDecoder_wbmp.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_wbmp.cpp
diff --git a/src/images/SkImageDecoder_wbmp.cpp b/src/images/SkImageDecoder_wbmp.cpp
index 8b1659ba8de1d2f505853b6e84aae81c0f379958..1b188518bcf56b8263b926e97421da965b9d43f3 100644
--- a/src/images/SkImageDecoder_wbmp.cpp
+++ b/src/images/SkImageDecoder_wbmp.cpp
@@ -22,18 +22,18 @@ public:
}
protected:
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE;
+ virtual bool onDecode(SkStreamRewindable* stream, SkBitmap* bm, Mode) SK_OVERRIDE;
private:
typedef SkImageDecoder INHERITED;
};
-static bool read_byte(SkStream* stream, uint8_t* data)
+static bool read_byte(SkStreamRewindable* stream, uint8_t* data)
{
return stream->read(data, 1) == 1;
}
-static bool read_mbf(SkStream* stream, int* value)
+static bool read_mbf(SkStreamRewindable* stream, int* value)
{
int n = 0;
uint8_t data;
@@ -52,7 +52,7 @@ struct wbmp_head {
int fWidth;
int fHeight;
- bool init(SkStream* stream)
+ bool init(SkStreamRewindable* stream)
{
uint8_t data;
@@ -99,7 +99,7 @@ static void expand_bits_to_bytes(uint8_t dst[], const uint8_t src[], int bits)
}
}
-bool SkWBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* decodedBitmap,
+bool SkWBMPImageDecoder::onDecode(SkStreamRewindable* stream, SkBitmap* decodedBitmap,
Mode mode)
{
wbmp_head head;
@@ -154,7 +154,7 @@ DEFINE_DECODER_CREATOR(WBMPImageDecoder);
#include "SkTRegistry.h"
-static SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_wbmp_dfactory(SkStreamRewindable* stream) {
wbmp_head head;
if (head.init(stream)) {
@@ -163,7 +163,7 @@ static SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) {
return NULL;
}
-static SkImageDecoder::Format get_format_wbmp(SkStream* stream) {
+static SkImageDecoder::Format get_format_wbmp(SkStreamRewindable* stream) {
wbmp_head head;
if (head.init(stream)) {
return SkImageDecoder::kWBMP_Format;
@@ -171,5 +171,5 @@ static SkImageDecoder::Format get_format_wbmp(SkStream* stream) {
return SkImageDecoder::kUnknown_Format;
}
-static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_wbmp_dfactory);
-static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_wbmp);
+static SkTRegistry<SkImageDecoder*, SkStreamRewindable*> gReg(sk_wbmp_dfactory);
+static SkTRegistry<SkImageDecoder::Format, SkStreamRewindable*> gFormatReg(get_format_wbmp);

Powered by Google App Engine
This is Rietveld 408576698