| OLD | NEW |
| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 case SkImageEncoder::kGIF_Type: | 253 case SkImageEncoder::kGIF_Type: |
| 254 case SkImageEncoder::kJPEG_Type: | 254 case SkImageEncoder::kJPEG_Type: |
| 255 case SkImageEncoder::kPNG_Type: | 255 case SkImageEncoder::kPNG_Type: |
| 256 break; | 256 break; |
| 257 default: | 257 default: |
| 258 return NULL; | 258 return NULL; |
| 259 } | 259 } |
| 260 return SkNEW_ARGS(SkImageEncoder_CG, (t)); | 260 return SkNEW_ARGS(SkImageEncoder_CG, (t)); |
| 261 } | 261 } |
| 262 | 262 |
| 263 static SkTRegistry<SkImageEncoder*, SkImageEncoder::Type> gEReg(sk_imageencoder_
cg_factory); | 263 static SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> gEReg(sk_imageencod
er_cg_factory); |
| 264 | 264 |
| 265 struct FormatConversion { | 265 struct FormatConversion { |
| 266 CFStringRef fUTType; | 266 CFStringRef fUTType; |
| 267 SkImageDecoder::Format fFormat; | 267 SkImageDecoder::Format fFormat; |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 // Array of the types supported by the decoder. | 270 // Array of the types supported by the decoder. |
| 271 static const FormatConversion gFormatConversions[] = { | 271 static const FormatConversion gFormatConversions[] = { |
| 272 { kUTTypeBMP, SkImageDecoder::kBMP_Format }, | 272 { kUTTypeBMP, SkImageDecoder::kBMP_Format }, |
| 273 { kUTTypeGIF, SkImageDecoder::kGIF_Format }, | 273 { kUTTypeGIF, SkImageDecoder::kGIF_Format }, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 295 } | 295 } |
| 296 | 296 |
| 297 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); | 297 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); |
| 298 const CFStringRef name = CGImageSourceGetType(imageSrc); | 298 const CFStringRef name = CGImageSourceGetType(imageSrc); |
| 299 if (NULL == name) { | 299 if (NULL == name) { |
| 300 return SkImageDecoder::kUnknown_Format; | 300 return SkImageDecoder::kUnknown_Format; |
| 301 } | 301 } |
| 302 return UTType_to_Format(name); | 302 return UTType_to_Format(name); |
| 303 } | 303 } |
| 304 | 304 |
| 305 static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_cg); | 305 static SkTRegistry<SkImageDecoder::Format(*)(SkStream*)> gFormatReg(get_format_c
g); |
| OLD | NEW |