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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 1401283003: Supply separate flags for onBuildTileIndex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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/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 4b0d18b8e4af4b4683270b839d762240f0243e0d..7216239e80b14b0f6e81dad66bdbfdcc4875a6d2 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -54,6 +54,10 @@ SK_CONF_DECLARE(bool, c_suppressJPEGImageDecoderErrors,
"Suppress most JPG error messages when decode "
"function fails.");
+#if defined(SK_BUILD_FOR_ANDROID) && !defined(SK_JPEG_NO_INDEX_SUPPORTED)
+#define SK_JPEG_INDEX_SUPPORTED
+#endif
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -85,7 +89,7 @@ static void initialize_info(jpeg_decompress_struct* cinfo, skjpeg_source_mgr* sr
}
}
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
class SkJPEGImageIndex {
public:
// Takes ownership of stream.
@@ -203,7 +207,7 @@ private:
class SkJPEGImageDecoder : public SkImageDecoder {
public:
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
SkJPEGImageDecoder() {
fImageIndex = nullptr;
fImageWidth = 0;
@@ -218,7 +222,7 @@ public:
}
protected:
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) override;
bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) override;
#endif
@@ -228,7 +232,7 @@ protected:
SkYUVColorSpace* colorSpace) override;
private:
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
SkJPEGImageIndex* fImageIndex;
int fImageWidth;
int fImageHeight;
@@ -295,7 +299,7 @@ static bool skip_src_rows(jpeg_decompress_struct* cinfo, void* buffer, int count
return true;
}
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
static bool skip_src_rows_tile(jpeg_decompress_struct* cinfo,
huffman_index *index, void* buffer, int count) {
for (int i = 0; i < count; i++) {
@@ -329,7 +333,7 @@ static bool return_false(const jpeg_decompress_struct& cinfo,
return false;
}
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
static bool return_false(const jpeg_decompress_struct& cinfo,
const SkBitmap& bm, const char caller[]) {
print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller);
@@ -939,7 +943,7 @@ bool SkJPEGImageDecoder::onDecodeYUV8Planes(SkStream* stream, SkISize componentS
///////////////////////////////////////////////////////////////////////////////
-#ifdef SK_BUILD_FOR_ANDROID
+#ifdef SK_JPEG_INDEX_SUPPORTED
bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width, int *height) {
SkAutoTDelete<SkJPEGImageIndex> imageIndex(new SkJPEGImageIndex(stream, this));
« no previous file with comments | « no previous file | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698