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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 21612003: Support decoding subsets from JPG on Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | src/images/SkJpegUtility.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 81904ae530df1d4029f00784b7e797de009c123b..d4047f197356a15b09bb02cd2a36089caf0d6df8 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2007 The Android Open Source Project
*
@@ -26,12 +25,6 @@ extern "C" {
#include "jerror.h"
}
-// Uncomment to enable the code path used by the Android framework with their
-// custom image decoders.
-//#if defined(SK_BUILD_FOR_ANDROID) && defined(SK_DEBUG)
-// #define SK_BUILD_FOR_ANDROID_FRAMEWORK
-//#endif
-
// These enable timing code that report milliseconds for an encoding/decoding
//#define TIME_ENCODE
//#define TIME_DECODE
@@ -68,7 +61,7 @@ public:
: fSrcMgr(stream, decoder) {}
~SkJPEGImageIndex() {
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
jpeg_destroy_huffman_index(&fHuffmanIndex);
#endif
jpeg_finish_decompress(&fCInfo);
@@ -87,14 +80,14 @@ public:
jpeg_decompress_struct* cinfo() { return &fCInfo; }
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
huffman_index* huffmanIndex() { return &fHuffmanIndex; }
#endif
private:
skjpeg_source_mgr fSrcMgr;
jpeg_decompress_struct fCInfo;
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
huffman_index fHuffmanIndex;
#endif
};
@@ -116,7 +109,7 @@ public:
}
protected:
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
virtual bool onBuildTileIndex(SkStream *stream, int *width, int *height) SK_OVERRIDE;
virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) SK_OVERRIDE;
#endif
@@ -180,7 +173,7 @@ static bool skip_src_rows(jpeg_decompress_struct* cinfo, void* buffer, int count
return true;
}
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
static bool skip_src_rows_tile(jpeg_decompress_struct* cinfo,
huffman_index *index, void* buffer, int count) {
for (int i = 0; i < count; i++) {
@@ -479,7 +472,7 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
return true;
}
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#ifdef SK_BUILD_FOR_ANDROID
bool SkJPEGImageDecoder::onBuildTileIndex(SkStream* stream, int *width, int *height) {
SkJPEGImageIndex* imageIndex = SkNEW_ARGS(SkJPEGImageIndex, (stream, this));
« no previous file with comments | « no previous file | src/images/SkJpegUtility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698