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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 2164283002: Drop support for libjpeg-turbo < 1.2 in SkJpegCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ifdefs Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index b78186359abc2a86378405bd69d1d9df802de2cd..f4116e324f82ca4e584e9080362735469abde463 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) {
msarett 2016/07/21 15:26:53 Just moved this code block because it was confusin
- 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698