Index: src/codec/SkJpegCodec.cpp |
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp |
index 7de97b39ab328cee0c58767b8f90df348f64fbdb..07ece6c95b5257d85b9d835fb948d13efe842cd9 100644 |
--- a/src/codec/SkJpegCodec.cpp |
+++ b/src/codec/SkJpegCodec.cpp |
@@ -518,15 +518,17 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& |
// libjpeg-turbo may have already performed color conversion. We must indicate the |
// appropriate format to the swizzler. |
SkEncodedInfo swizzlerInfo = this->getEncodedInfo(); |
+ bool preSwizzled = true; |
switch (fDecoderMgr->dinfo()->out_color_space) { |
case JCS_RGB: |
+ preSwizzled = false; |
swizzlerInfo.setColor(SkEncodedInfo::kRGB_Color); |
break; |
case JCS_CMYK: |
+ preSwizzled = false; |
swizzlerInfo.setColor(SkEncodedInfo::kInvertedCMYK_Color); |
break; |
default: |
- swizzlerInfo.setColor(SkEncodedInfo::kPreSwizzled_Color); |
break; |
} |
@@ -539,7 +541,8 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& |
fSwizzlerSubset.width() == options.fSubset->width()); |
swizzlerOptions.fSubset = &fSwizzlerSubset; |
} |
- fSwizzler.reset(SkSwizzler::CreateSwizzler(swizzlerInfo, nullptr, dstInfo, swizzlerOptions)); |
+ fSwizzler.reset(SkSwizzler::CreateSwizzler(swizzlerInfo, nullptr, dstInfo, swizzlerOptions, |
+ nullptr, preSwizzled)); |
SkASSERT(fSwizzler); |
fStorage.reset(get_row_bytes(fDecoderMgr->dinfo())); |
fSrcRow = fStorage.get(); |