Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1918943002: Remove SkEncodedInfo kPreSwizzled_Color from public API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
« no previous file with comments | « include/codec/SkEncodedInfo.h ('k') | src/codec/SkSwizzler.h » ('j') | src/codec/SkSwizzler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698