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

Side by Side Diff: src/codec/SkJpegCodec.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, 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 unified diff | Download patch
« no previous file with comments | « include/codec/SkEncodedInfo.h ('k') | src/codec/SkJpegDecoderMgr.h » ('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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkMSAN.h" 9 #include "SkMSAN.h"
10 #include "SkJpegCodec.h" 10 #include "SkJpegCodec.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 jpeg_save_markers(decoderMgr->dinfo(), kICCMarker, 0xFFFF); 205 jpeg_save_markers(decoderMgr->dinfo(), kICCMarker, 0xFFFF);
206 } 206 }
207 207
208 // Read the jpeg header 208 // Read the jpeg header
209 if (JPEG_HEADER_OK != jpeg_read_header(decoderMgr->dinfo(), true)) { 209 if (JPEG_HEADER_OK != jpeg_read_header(decoderMgr->dinfo(), true)) {
210 return decoderMgr->returnFalse("read_header"); 210 return decoderMgr->returnFalse("read_header");
211 } 211 }
212 212
213 if (codecOut) { 213 if (codecOut) {
214 // Get the encoded color type 214 // Get the encoded color type
215 SkEncodedInfo::Color color = decoderMgr->getEncodedColor(); 215 SkEncodedInfo::Color color;
216 if (SkEncodedInfo::kUnknown_Color == color) { 216 if (!decoderMgr->getEncodedColor(&color)) {
217 return false; 217 return false;
218 } 218 }
219 219
220 // Create image info object and the codec 220 // Create image info object and the codec
221 SkEncodedInfo info = SkEncodedInfo::Make(color, SkEncodedInfo::kOpaque_A lpha, 8); 221 SkEncodedInfo info = SkEncodedInfo::Make(color, SkEncodedInfo::kOpaque_A lpha, 8);
222 222
223 Origin orientation = get_exif_orientation(decoderMgr->dinfo()); 223 Origin orientation = get_exif_orientation(decoderMgr->dinfo());
224 sk_sp<SkColorSpace> colorSpace = get_icc_profile(decoderMgr->dinfo()); 224 sk_sp<SkColorSpace> colorSpace = get_icc_profile(decoderMgr->dinfo());
225 225
226 const int width = decoderMgr->dinfo()->image_width; 226 const int width = decoderMgr->dinfo()->image_width;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 887
888 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 888 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
889 if (linesRead < remainingRows) { 889 if (linesRead < remainingRows) {
890 // FIXME: Handle incomplete YUV decodes without signalling an error. 890 // FIXME: Handle incomplete YUV decodes without signalling an error.
891 return kInvalidInput; 891 return kInvalidInput;
892 } 892 }
893 } 893 }
894 894
895 return kSuccess; 895 return kSuccess;
896 } 896 }
OLDNEW
« no previous file with comments | « include/codec/SkEncodedInfo.h ('k') | src/codec/SkJpegDecoderMgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698