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:
parent
dd96eb4f5c
commit
3acd3fcfad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user