diff options
author | jvanverth <jvanverth@google.com> | 2015-07-02 10:40:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-02 10:40:24 -0700 |
commit | 94a2fbc6cf7cc14d7e6149eb22455db6aca06b8f (patch) | |
tree | bfe574845dc33bc8b8700c74ff3a3b613fc48ec7 /src/codec/SkJpegDecoderMgr.cpp | |
parent | 6c90e09575c1a77aee060aa475fdb3d25a17d6a0 (diff) |
Revert of Switch SkJpegCode to libjpeg-turbo (patchset #29 id:750001 of https://codereview.chromium.org/1180983002/)
Reason for revert:
DEPS roll failing
Original issue's description:
> 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:
>
> Committed: https://skia.googlesource.com/skia/+/b60c3f8291529303299262dba19b1a896060bd2d
>
> Committed: https://skia.googlesource.com/skia/+/f8bf9181d7b0463c8e371755cfbb9ece90b34fc5
>
> Committed: https://skia.googlesource.com/skia/+/e9e3ee33f30c14c31afd5fc3fe4dda7f15783c75
>
> Committed: https://skia.googlesource.com/skia/+/40141b57f061fbfcc2fa38da942d9efe25aca4d0
TBR=scroggo@google.com,djsollen@google.com,emmaleer@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1226543003
Diffstat (limited to 'src/codec/SkJpegDecoderMgr.cpp')
-rw-r--r-- | src/codec/SkJpegDecoderMgr.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/codec/SkJpegDecoderMgr.cpp b/src/codec/SkJpegDecoderMgr.cpp index b5a12297a0..f0ed4522ca 100644 --- a/src/codec/SkJpegDecoderMgr.cpp +++ b/src/codec/SkJpegDecoderMgr.cpp @@ -39,9 +39,22 @@ 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; } } @@ -51,7 +64,7 @@ JpegDecoderMgr::JpegDecoderMgr(SkStream* stream) , 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; } |