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

Unified Diff: src/images/SkImageDecoder.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/animator/SkDrawBitmap.cpp ('k') | src/images/SkImageDecoder_FactoryDefault.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder.cpp
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 7c4c477e078c40fbb584da79590e775a30229775..1544edf366bca7939bebae7faa1faaef536dec06 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -213,8 +213,8 @@ bool SkImageDecoder::decodeSubset(SkBitmap* bm, const SkIRect& rect,
return this->onDecodeSubset(bm, rect);
}
-bool SkImageDecoder::buildTileIndex(SkStream* stream,
- int *width, int *height) {
+bool SkImageDecoder::buildTileIndex(SkStreamRewindable* stream,
+ int *width, int *height) {
// we reset this to false before calling onBuildTileIndex
fShouldCancelDecode = false;
@@ -276,7 +276,7 @@ bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm,
SkASSERT(file);
SkASSERT(bm);
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(file));
+ SkAutoTUnref<SkStreamRewindable> stream(SkStream::NewFromFile(file));
if (stream.get()) {
if (SkImageDecoder::DecodeStream(stream, bm, pref, mode, format)) {
bm->pixelRef()->setURI(file);
@@ -445,8 +445,9 @@ bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size,
}
-bool SkImageDecoder::DecodeStream(SkStream* stream, SkBitmap* bm,
- SkBitmap::Config pref, Mode mode, Format* format) {
+bool SkImageDecoder::DecodeStream(SkStreamRewindable* stream, SkBitmap* bm,
+ SkBitmap::Config pref, Mode mode,
+ Format* format) {
SkASSERT(stream);
SkASSERT(bm);
« no previous file with comments | « src/animator/SkDrawBitmap.cpp ('k') | src/images/SkImageDecoder_FactoryDefault.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698