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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 case SkImageEncoder::kPNG_Type: | 293 case SkImageEncoder::kPNG_Type: |
294 break; | 294 break; |
295 default: | 295 default: |
296 return NULL; | 296 return NULL; |
297 } | 297 } |
298 return SkNEW_ARGS(SkImageEncoder_CG, (t)); | 298 return SkNEW_ARGS(SkImageEncoder_CG, (t)); |
299 } | 299 } |
300 | 300 |
301 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_cg_factory); | 301 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_cg_factory); |
302 | 302 |
| 303 #ifdef SK_BUILD_FOR_IOS |
| 304 class SkPNGImageEncoder_IOS : public SkImageEncoder_CG { |
| 305 public: |
| 306 SkPNGImageEncoder_IOS() |
| 307 : SkImageEncoder_CG(kPNG_Type) { |
| 308 } |
| 309 }; |
| 310 |
| 311 DEFINE_ENCODER_CREATOR(PNGImageEncoder_IOS); |
| 312 #endif |
| 313 |
303 struct FormatConversion { | 314 struct FormatConversion { |
304 CFStringRef fUTType; | 315 CFStringRef fUTType; |
305 SkImageDecoder::Format fFormat; | 316 SkImageDecoder::Format fFormat; |
306 }; | 317 }; |
307 | 318 |
308 // Array of the types supported by the decoder. | 319 // Array of the types supported by the decoder. |
309 static const FormatConversion gFormatConversions[] = { | 320 static const FormatConversion gFormatConversions[] = { |
310 { kUTTypeBMP, SkImageDecoder::kBMP_Format }, | 321 { kUTTypeBMP, SkImageDecoder::kBMP_Format }, |
311 { kUTTypeGIF, SkImageDecoder::kGIF_Format }, | 322 { kUTTypeGIF, SkImageDecoder::kGIF_Format }, |
312 { kUTTypeICO, SkImageDecoder::kICO_Format }, | 323 { kUTTypeICO, SkImageDecoder::kICO_Format }, |
(...skipping 21 matching lines...) Expand all Loading... |
334 | 345 |
335 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); | 346 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); |
336 const CFStringRef name = CGImageSourceGetType(imageSrc); | 347 const CFStringRef name = CGImageSourceGetType(imageSrc); |
337 if (NULL == name) { | 348 if (NULL == name) { |
338 return SkImageDecoder::kUnknown_Format; | 349 return SkImageDecoder::kUnknown_Format; |
339 } | 350 } |
340 return UTType_to_Format(name); | 351 return UTType_to_Format(name); |
341 } | 352 } |
342 | 353 |
343 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); | 354 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); |
OLD | NEW |