aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-16 14:50:54 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-16 14:50:54 +0000
commit9ce225772902ec909e4b9e00cd2a7a89fe925262 (patch)
tree5072a5653cca05e68cdfac04d0d7384642417a95 /src/images
parenta44b4cc7976b06caf3a3f6b7913c2af92eb32217 (diff)
quick return if we just want the bounds
git-svn-id: http://skia.googlecode.com/svn/trunk@269 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/images')
-rw-r--r--src/images/SkImageDecoder_libjpeg.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 018c96c353..cc0f8a9d7c 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -343,6 +343,12 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm,
}
#endif
+ if (sampleSize == 1 && mode == SkImageDecoder::kDecodeBounds_Mode) {
+ bm->setConfig(config, cinfo.image_width, cinfo.image_height);
+ bm->setIsOpaque(true);
+ return true;
+ }
+
/* image_width and image_height are the original dimensions, available
after jpeg_read_header(). To see the scaled dimensions, we have to call
jpeg_start_decompress(), and then read output_width and output_height.