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

Side by Side Diff: src/ports/SkImageDecoder_CG.cpp

Issue 234833003: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/images/SkDecodingImageGenerator.cpp ('k') | src/ports/SkImageDecoder_WIC.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkCGUtils.h" 8 #include "SkCGUtils.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 case kJPEG_Type: 202 case kJPEG_Type:
203 type = kUTTypeJPEG; 203 type = kUTTypeJPEG;
204 break; 204 break;
205 case kPNG_Type: 205 case kPNG_Type:
206 // PNG encoding an ARGB_4444 bitmap gives the following errors in GM : 206 // PNG encoding an ARGB_4444 bitmap gives the following errors in GM :
207 // <Error>: CGImageDestinationAddImage image could not be converted to destination 207 // <Error>: CGImageDestinationAddImage image could not be converted to destination
208 // format. 208 // format.
209 // <Error>: CGImageDestinationFinalize image destination does not ha ve enough images 209 // <Error>: CGImageDestinationFinalize image destination does not ha ve enough images
210 // So instead we copy to 8888. 210 // So instead we copy to 8888.
211 if (bm.colorType() == kARGB_4444_SkColorType) { 211 if (bm.colorType() == kARGB_4444_SkColorType) {
212 bm.copyTo(&bitmap8888, kN32_SkColorType); 212 bm.copyTo(&bitmap8888, kPMColor_SkColorType);
213 bmPtr = &bitmap8888; 213 bmPtr = &bitmap8888;
214 } 214 }
215 type = kUTTypePNG; 215 type = kUTTypePNG;
216 break; 216 break;
217 default: 217 default:
218 return false; 218 return false;
219 } 219 }
220 220
221 CGImageDestinationRef dst = SkStreamToImageDestination(stream, type); 221 CGImageDestinationRef dst = SkStreamToImageDestination(stream, type);
222 if (NULL == dst) { 222 if (NULL == dst) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 287 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
288 const CFStringRef name = CGImageSourceGetType(imageSrc); 288 const CFStringRef name = CGImageSourceGetType(imageSrc);
289 if (NULL == name) { 289 if (NULL == name) {
290 return SkImageDecoder::kUnknown_Format; 290 return SkImageDecoder::kUnknown_Format;
291 } 291 }
292 return UTType_to_Format(name); 292 return UTType_to_Format(name);
293 } 293 }
294 294
295 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); 295 static SkImageDecoder_FormatReg gFormatReg(get_format_cg);
OLDNEW
« no previous file with comments | « src/images/SkDecodingImageGenerator.cpp ('k') | src/ports/SkImageDecoder_WIC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698