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

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

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkCanvasStateUtils.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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 break; 212 break;
213 case kJPEG_Type: 213 case kJPEG_Type:
214 type = kUTTypeJPEG; 214 type = kUTTypeJPEG;
215 break; 215 break;
216 case kPNG_Type: 216 case kPNG_Type:
217 // PNG encoding an ARGB_4444 bitmap gives the following errors in GM : 217 // PNG encoding an ARGB_4444 bitmap gives the following errors in GM :
218 // <Error>: CGImageDestinationAddImage image could not be converted to destination 218 // <Error>: CGImageDestinationAddImage image could not be converted to destination
219 // format. 219 // format.
220 // <Error>: CGImageDestinationFinalize image destination does not ha ve enough images 220 // <Error>: CGImageDestinationFinalize image destination does not ha ve enough images
221 // So instead we copy to 8888. 221 // So instead we copy to 8888.
222 if (bm.getConfig() == SkBitmap::kARGB_4444_Config) { 222 if (bm.config() == SkBitmap::kARGB_4444_Config) {
223 bm.copyTo(&bitmap8888, SkBitmap::kARGB_8888_Config); 223 bm.copyTo(&bitmap8888, SkBitmap::kARGB_8888_Config);
224 bmPtr = &bitmap8888; 224 bmPtr = &bitmap8888;
225 } 225 }
226 type = kUTTypePNG; 226 type = kUTTypePNG;
227 break; 227 break;
228 default: 228 default:
229 return false; 229 return false;
230 } 230 }
231 231
232 CGImageDestinationRef dst = SkStreamToImageDestination(stream, type); 232 CGImageDestinationRef dst = SkStreamToImageDestination(stream, type);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 298 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
299 const CFStringRef name = CGImageSourceGetType(imageSrc); 299 const CFStringRef name = CGImageSourceGetType(imageSrc);
300 if (NULL == name) { 300 if (NULL == name) {
301 return SkImageDecoder::kUnknown_Format; 301 return SkImageDecoder::kUnknown_Format;
302 } 302 }
303 return UTType_to_Format(name); 303 return UTType_to_Format(name);
304 } 304 }
305 305
306 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); 306 static SkImageDecoder_FormatReg gFormatReg(get_format_cg);
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698