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

Unified Diff: src/ports/SkImageDecoder_WIC.cpp

Issue 23477009: Change SkImageDecoders to take an SkStreamRewindable. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Only switch to SkStreamRewindable when necessary. Created 7 years, 3 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
« no previous file with comments | « src/ports/SkImageDecoder_CG.cpp ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkImageDecoder_WIC.cpp
diff --git a/src/ports/SkImageDecoder_WIC.cpp b/src/ports/SkImageDecoder_WIC.cpp
index 54d0427a8d26f03d2629f6080fc4fba5c938eedf..7b2ae9e7ed6d06839a6bd9ccb055d8d00731f1eb 100644
--- a/src/ports/SkImageDecoder_WIC.cpp
+++ b/src/ports/SkImageDecoder_WIC.cpp
@@ -230,9 +230,9 @@ bool SkImageDecoder_WIC::decodeStream(SkStream* stream, SkBitmap* bm, WICModes w
/////////////////////////////////////////////////////////////////////////
-extern SkImageDecoder* image_decoder_from_stream(SkStream*);
+extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*);
-SkImageDecoder* SkImageDecoder::Factory(SkStream* stream) {
+SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
SkImageDecoder* decoder = image_decoder_from_stream(stream);
if (NULL == decoder) {
// If no image decoder specific to the stream exists, use SkImageDecoder_WIC.
@@ -244,7 +244,7 @@ SkImageDecoder* SkImageDecoder::Factory(SkStream* stream) {
/////////////////////////////////////////////////////////////////////////
-SkMovie* SkMovie::DecodeStream(SkStream* stream) {
+SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
return NULL;
}
@@ -417,8 +417,6 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream
///////////////////////////////////////////////////////////////////////////////
-#include "SkTRegistry.h"
-
static SkImageEncoder* sk_imageencoder_wic_factory(SkImageEncoder::Type t) {
switch (t) {
case SkImageEncoder::kBMP_Type:
@@ -432,9 +430,9 @@ static SkImageEncoder* sk_imageencoder_wic_factory(SkImageEncoder::Type t) {
return SkNEW_ARGS(SkImageEncoder_WIC, (t));
}
-static SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> gEReg(sk_imageencoder_wic_factory);
+static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_wic_factory);
-static SkImageDecoder::Format get_format_wic(SkStream* stream) {
+static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) {
SkImageDecoder::Format format;
SkImageDecoder_WIC codec;
if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICMode, &format)) {
@@ -443,4 +441,4 @@ static SkImageDecoder::Format get_format_wic(SkStream* stream) {
return format;
}
-static SkTRegistry<SkImageDecoder::Format(*)(SkStream*)> gFormatReg(get_format_wic);
+static SkImageDecoder_FormatReg gFormatReg(get_format_wic);
« no previous file with comments | « src/ports/SkImageDecoder_CG.cpp ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698