Only use JDCT_FAST if it is supported in jpeg.

Fixes a bug where jpeg decoder did not work on linux.

Review URL: https://codereview.chromium.org/14188002

git-svn-id: http://skia.googlecode.com/svn/trunk@8661 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
scroggo@google.com 2013-04-12 16:28:21 +00:00
parent dd96eb4f5c
commit 3acd3fcfad

View File

@ -268,11 +268,15 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
*/
int sampleSize = this->getSampleSize();
#ifdef DCT_IFAST_SUPPORTED
if (this->getPreferQualityOverSpeed()) {
cinfo.dct_method = JDCT_ISLOW;
} else {
cinfo.dct_method = JDCT_IFAST;
}
#else
cinfo.dct_method = JDCT_ISLOW;
#endif
cinfo.scale_num = 1;
cinfo.scale_denom = sampleSize;