diff options
author | msarett <msarett@google.com> | 2015-06-24 15:10:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-24 15:10:25 -0700 |
commit | b60c3f8291529303299262dba19b1a896060bd2d (patch) | |
tree | 2d4c774d17be4085a99189435ed3381e8f462b35 /src/codec/SkJpegDecoderMgr.cpp | |
parent | 47c1ccbcd8e17efdc89a325e314c414a7c75846c (diff) |
Add libjpeg-turbo library (depends on yasm)
Mangle external function names to avoid conflict with libjpeg
Take advantage of direct color conversion (RGBA, BGRA, 565)
Prepare to use jpeg_skip_scanlines (when it is upstreamed)
BUG=skia:
Review URL: https://codereview.chromium.org/1180983002
Diffstat (limited to 'src/codec/SkJpegDecoderMgr.cpp')
-rw-r--r-- | src/codec/SkJpegDecoderMgr.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/codec/SkJpegDecoderMgr.cpp b/src/codec/SkJpegDecoderMgr.cpp index f0ed4522ca..b5a12297a0 100644 --- a/src/codec/SkJpegDecoderMgr.cpp +++ b/src/codec/SkJpegDecoderMgr.cpp @@ -39,22 +39,9 @@ SkCodec::Result JpegDecoderMgr::returnFailure(const char caller[], SkCodec::Resu 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; } } @@ -64,7 +51,7 @@ JpegDecoderMgr::JpegDecoderMgr(SkStream* stream) , fInit(false) { // Error manager must be set before any calls to libjeg in order to handle failures - fDInfo.err = jpeg_std_error(&fErrorMgr); + fDInfo.err = turbo_jpeg_std_error(&fErrorMgr); fErrorMgr.error_exit = skjpeg_err_exit; } |