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

Side by Side Diff: src/codec/SkJpegDecoderMgr.cpp

Issue 1918873002: Remove SkEncodedInfo kUnknown_Color and kUnknown_Alpha from public API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix errors Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/codec/SkJpegDecoderMgr.h ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkJpegDecoderMgr.h" 8 #include "SkJpegDecoderMgr.h"
9 9
10 #include "SkJpegUtility.h" 10 #include "SkJpegUtility.h"
(...skipping 17 matching lines...) Expand all
28 bool JpegDecoderMgr::returnFalse(const char caller[]) { 28 bool JpegDecoderMgr::returnFalse(const char caller[]) {
29 print_message((j_common_ptr) &fDInfo, caller); 29 print_message((j_common_ptr) &fDInfo, caller);
30 return false; 30 return false;
31 } 31 }
32 32
33 SkCodec::Result JpegDecoderMgr::returnFailure(const char caller[], SkCodec::Resu lt result) { 33 SkCodec::Result JpegDecoderMgr::returnFailure(const char caller[], SkCodec::Resu lt result) {
34 print_message((j_common_ptr) &fDInfo, caller); 34 print_message((j_common_ptr) &fDInfo, caller);
35 return result; 35 return result;
36 } 36 }
37 37
38 SkEncodedInfo::Color JpegDecoderMgr::getEncodedColor() { 38 bool JpegDecoderMgr::getEncodedColor(SkEncodedInfo::Color* outColor) {
39 switch (fDInfo.jpeg_color_space) { 39 switch (fDInfo.jpeg_color_space) {
40 case JCS_GRAYSCALE: 40 case JCS_GRAYSCALE:
41 return SkEncodedInfo::kGray_Color; 41 *outColor = SkEncodedInfo::kGray_Color;
42 return true;
42 case JCS_YCbCr: 43 case JCS_YCbCr:
43 return SkEncodedInfo::kYUV_Color; 44 *outColor = SkEncodedInfo::kYUV_Color;
45 return true;
44 case JCS_RGB: 46 case JCS_RGB:
45 return SkEncodedInfo::kRGB_Color; 47 *outColor = SkEncodedInfo::kRGB_Color;
48 return true;
46 case JCS_YCCK: 49 case JCS_YCCK:
47 return SkEncodedInfo::kYCCK_Color; 50 *outColor = SkEncodedInfo::kYCCK_Color;
51 return true;
48 case JCS_CMYK: 52 case JCS_CMYK:
49 return SkEncodedInfo::kInvertedCMYK_Color; 53 *outColor = SkEncodedInfo::kInvertedCMYK_Color;
54 return true;
50 default: 55 default:
51 return SkEncodedInfo::kUnknown_Color; 56 return false;
52 } 57 }
53 } 58 }
54 59
55 JpegDecoderMgr::JpegDecoderMgr(SkStream* stream) 60 JpegDecoderMgr::JpegDecoderMgr(SkStream* stream)
56 : fSrcMgr(stream) 61 : fSrcMgr(stream)
57 , fInit(false) 62 , fInit(false)
58 { 63 {
59 // Error manager must be set before any calls to libjeg in order to handle f ailures 64 // Error manager must be set before any calls to libjeg in order to handle f ailures
60 fDInfo.err = jpeg_std_error(&fErrorMgr); 65 fDInfo.err = jpeg_std_error(&fErrorMgr);
61 fErrorMgr.error_exit = skjpeg_err_exit; 66 fErrorMgr.error_exit = skjpeg_err_exit;
(...skipping 12 matching lines...) Expand all
74 } 79 }
75 } 80 }
76 81
77 jmp_buf& JpegDecoderMgr::getJmpBuf() { 82 jmp_buf& JpegDecoderMgr::getJmpBuf() {
78 return fErrorMgr.fJmpBuf; 83 return fErrorMgr.fJmpBuf;
79 } 84 }
80 85
81 jpeg_decompress_struct* JpegDecoderMgr::dinfo() { 86 jpeg_decompress_struct* JpegDecoderMgr::dinfo() {
82 return &fDInfo; 87 return &fDInfo;
83 } 88 }
OLDNEW
« no previous file with comments | « src/codec/SkJpegDecoderMgr.h ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698