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

Unified Diff: src/codec/SkJpegDecoderMgr.cpp

Issue 1213093003: Revert of Switch SkJpegCode to libjpeg-turbo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkJpegDecoderMgr.h ('k') | src/codec/SkJpegUtility_codec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegDecoderMgr.cpp
diff --git a/src/codec/SkJpegDecoderMgr.cpp b/src/codec/SkJpegDecoderMgr.cpp
index b5a12297a0c41b4f3e74ab194b0c66de14ff6842..f0ed4522ca6e562eac23e5134e8bc315c02d7c60 100644
--- a/src/codec/SkJpegDecoderMgr.cpp
+++ b/src/codec/SkJpegDecoderMgr.cpp
@@ -39,9 +39,22 @@
SkColorType JpegDecoderMgr::getColorType() {
switch (fDInfo.jpeg_color_space) {
+ case JCS_CMYK:
+ case JCS_YCCK:
+ // libjpeg cannot convert from CMYK or YCCK to RGB.
+ // Here, we ask libjpeg to give us CMYK samples back and
+ // we will later manually convert them to RGB.
+ fDInfo.out_color_space = JCS_CMYK;
+ return kN32_SkColorType;
case JCS_GRAYSCALE:
+ fDInfo.out_color_space = JCS_GRAYSCALE;
return kGray_8_SkColorType;
default:
+#ifdef ANDROID_RGB
+ fDInfo.out_color_space = JCS_RGBA_8888;
+#else
+ fDInfo.out_color_space = JCS_RGB;
+#endif
return kN32_SkColorType;
}
}
@@ -51,7 +64,7 @@
, fInit(false)
{
// Error manager must be set before any calls to libjeg in order to handle failures
- fDInfo.err = turbo_jpeg_std_error(&fErrorMgr);
+ fDInfo.err = jpeg_std_error(&fErrorMgr);
fErrorMgr.error_exit = skjpeg_err_exit;
}
« no previous file with comments | « src/codec/SkJpegDecoderMgr.h ('k') | src/codec/SkJpegUtility_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698