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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libjpeg.cpp
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 8c9d26783ca40c82ab4be6ae7d5fc0569d2bdf65..e0722e18dc60972719d2634fa06c48dd58070b4e 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -105,8 +105,10 @@ static void initialize_info(jpeg_decompress_struct* cinfo, skjpeg_source_mgr* sr
#ifdef SK_BUILD_FOR_ANDROID
class SkJPEGImageIndex {
public:
+ // Takes ownership of stream.
SkJPEGImageIndex(SkStreamRewindable* stream, SkImageDecoder* decoder)
: fSrcMgr(stream, decoder)
+ , fStream(stream)
, fInfoInitialized(false)
, fHuffmanCreated(false)
, fDecompressStarted(false)
@@ -206,6 +208,7 @@ public:
private:
skjpeg_source_mgr fSrcMgr;
+ SkAutoTDelete<SkStream> fStream;
jpeg_decompress_struct fCInfo;
huffman_index fHuffmanIndex;
bool fInfoInitialized;
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698