diff options
author | msarett <msarett@google.com> | 2016-07-21 12:00:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 12:00:24 -0700 |
commit | f25bff95db388554027c78df709f78f8278fffed (patch) | |
tree | 04182c1c930eeb3d83722028339efff2992aa16e /src/codec | |
parent | 530c844d25340eb2f2a4500c99c3f9d04a95b66e (diff) |
Drop support for libjpeg-turbo < 1.2 in SkJpegCodec
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164283002
Review-Url: https://codereview.chromium.org/2164283002
Diffstat (limited to 'src/codec')
-rw-r--r-- | src/codec/SkJpegCodec.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp index b78186359a..f4116e324f 100644 --- a/src/codec/SkJpegCodec.cpp +++ b/src/codec/SkJpegCodec.cpp @@ -373,22 +373,14 @@ bool SkJpegCodec::setOutputColorSpace(const SkImageInfo& dst) { if (isCMYK) { fDecoderMgr->dinfo()->out_color_space = JCS_CMYK; } else { -#ifdef LIBJPEG_TURBO_VERSION - fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; -#else - fDecoderMgr->dinfo()->out_color_space = JCS_RGB; -#endif + fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; } return true; case kBGRA_8888_SkColorType: if (isCMYK) { fDecoderMgr->dinfo()->out_color_space = JCS_CMYK; } else { -#ifdef LIBJPEG_TURBO_VERSION - fDecoderMgr->dinfo()->out_color_space = JCS_EXT_BGRA; -#else - fDecoderMgr->dinfo()->out_color_space = JCS_RGB; -#endif + fDecoderMgr->dinfo()->out_color_space = JCS_EXT_BGRA; } return true; case kRGB_565_SkColorType: @@ -517,7 +509,6 @@ SkCodec::Result SkJpegCodec::onGetPixels(const SkImageInfo& dstInfo, // If we cannot read enough rows, assume the input is incomplete if (lines != 1) { *rowsDecoded = y; - return fDecoderMgr->returnFailure("Incomplete image data", kIncompleteInput); } @@ -600,10 +591,6 @@ SkCodec::Result SkJpegCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, return kInvalidInput; } - if (options.fSubset) { - fSwizzlerSubset = *options.fSubset; - } - #ifdef TURBO_HAS_CROP if (options.fSubset) { uint32_t startX = options.fSubset->x(); @@ -647,6 +634,10 @@ SkCodec::Result SkJpegCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, this->initializeSwizzler(dstInfo, options); } #else + if (options.fSubset) { + fSwizzlerSubset = *options.fSubset; + } + // We will need a swizzler if we are performing a subset decode or // converting from CMYK. J_COLOR_SPACE colorSpace = fDecoderMgr->dinfo()->out_color_space; |