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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1907593004: Support the non-native (RGBA/BGRA) swizzle (Closed) Base URL: https://skia.googlesource.com/skia.git@tryagain
Patch Set: Multiple bug fixes 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
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkMaskSwizzler.cpp » ('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 8d32f2b44d36f400756ce5ab7a60ff052168b420..0799e813813d719fdcb0ba6561daa689ed3d3bde 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -350,18 +350,23 @@ bool SkJpegCodec::setOutputColorSpace(const SkImageInfo& dst) {
// Check for valid color types and set the output color space
switch (dst.colorType()) {
- case kN32_SkColorType:
+ case kRGBA_8888_SkColorType:
if (isCMYK) {
fDecoderMgr->dinfo()->out_color_space = JCS_CMYK;
} else {
#ifdef LIBJPEG_TURBO_VERSION
- // Check the byte ordering of the RGBA color space for the
- // current platform
- #ifdef SK_PMCOLOR_IS_RGBA
fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;
- #else
+#else
+ fDecoderMgr->dinfo()->out_color_space = JCS_RGB;
+#endif
+ }
+ 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;
- #endif
#else
fDecoderMgr->dinfo()->out_color_space = JCS_RGB;
#endif
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkMaskSwizzler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698