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

Unified Diff: src/images/SkImageDecoder_libico.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_libico.cpp
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index 47fa7293f0a54b5410d8f361da4a23577d468479..78c9a095881b33ae98757721412a79fd87db90d6 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -20,7 +20,7 @@ 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;
@@ -72,7 +72,7 @@ static int calculateRowBytesFor8888(int w, int bitCount)
return 0;
}
-bool SkICOImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode)
+bool SkICOImageDecoder::onDecode(SkStreamRewindable* stream, SkBitmap* bm, Mode mode)
{
SkAutoMalloc autoMal;
const size_t length = CopyStreamToStorage(&autoMal, stream);
@@ -383,7 +383,7 @@ static void editPixelBit32(const int pixelNo, const unsigned char* buf,
DEFINE_DECODER_CREATOR(ICOImageDecoder);
/////////////////////////////////////////////////////////////////////////////////////////
-static bool is_ico(SkStream* stream) {
+static bool is_ico(SkStreamRewindable* stream) {
// Check to see if the first four bytes are 0,0,1,0
// FIXME: Is that required and sufficient?
SkAutoMalloc autoMal(4);
@@ -400,20 +400,20 @@ static bool is_ico(SkStream* stream) {
#include "SkTRegistry.h"
-static SkImageDecoder* sk_libico_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_libico_dfactory(SkStreamRewindable* stream) {
if (is_ico(stream)) {
return SkNEW(SkICOImageDecoder);
}
return NULL;
}
-static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_libico_dfactory);
+static SkTRegistry<SkImageDecoder*, SkStreamRewindable*> gReg(sk_libico_dfactory);
-static SkImageDecoder::Format get_format_ico(SkStream* stream) {
+static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) {
if (is_ico(stream)) {
return SkImageDecoder::kICO_Format;
}
return SkImageDecoder::kUnknown_Format;
}
-static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_ico);
+static SkTRegistry<SkImageDecoder::Format, SkStreamRewindable*> gFormatReg(get_format_ico);

Powered by Google App Engine
This is Rietveld 408576698