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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1582083005: Clean up unused or overly complex modes in SkSwizzler (Closed) Base URL: https://skia.googlesource.com/skia.git@neon-unpremul
Patch Set: Response to comments Created 4 years, 11 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 | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkSwizzler.h » ('j') | 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 7db772da6386ad9a3b0002d5334598a625fd6fa2..89925fb4645979e78721e0ad75a162cb59f72c3d 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -329,18 +329,17 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options&
if (JCS_CMYK == fDecoderMgr->dinfo()->out_color_space) {
srcConfig = SkSwizzler::kCMYK;
} else {
+ // If the out_color_space is not CMYK, the only reason we would need a swizzler is
+ // for sampling and/or subsetting.
switch (dstInfo.colorType()) {
case kGray_8_SkColorType:
- srcConfig = SkSwizzler::kGray;
+ srcConfig = SkSwizzler::kNoOp8;
break;
- case kRGBA_8888_SkColorType:
- srcConfig = SkSwizzler::kRGBX;
- break;
- case kBGRA_8888_SkColorType:
- srcConfig = SkSwizzler::kBGRX;
+ case kN32_SkColorType:
+ srcConfig = SkSwizzler::kNoOp32;
break;
case kRGB_565_SkColorType:
- srcConfig = SkSwizzler::kRGB_565;
+ srcConfig = SkSwizzler::kNoOp16;
break;
default:
// This function should only be called if the colorType is supported by jpeg
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698