Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2009 The Android Open Source Project | 3 * Copyright 2009 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkImageEncoder.h" | 9 #include "SkImageEncoder.h" |
| 10 | 10 |
| 11 template SkImageEncoder_EncodeReg* SkImageEncoder_EncodeReg::gHead; | 11 #include "SkImageDecoder_libpng.h" |
| 12 #include "SkImageDecoder_libjpeg.h" | |
| 13 #include "SkImageDecoder_libwebp.h" | |
| 14 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) | |
| 15 #include "SkImageDecoder_ktx.h" | |
| 16 #endif | |
| 17 #if defined(SK_BUILD_FOR_WIN) | |
| 18 #include "SkImageDecoder_WIC.h" | |
| 19 #endif | |
| 20 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | |
| 21 #include "SkImageDecoder_CG.h" | |
| 22 #endif | |
| 12 | 23 |
| 13 SkImageEncoder* SkImageEncoder::Create(Type t) { | 24 SkImageEncoder* SkImageEncoder::Create(Type t) { |
| 14 SkImageEncoder* codec = NULL; | 25 SkImageEncoder* codec = NULL; |
| 15 const SkImageEncoder_EncodeReg* curr = SkImageEncoder_EncodeReg::Head(); | 26 #if defined(SK_BUILD_FOR_WIN) |
|
Kimmo Kinnunen
2014/10/20 14:03:39
I can double-check the encoder order and fix poten
scroggo
2014/11/12 18:00:13
FYI, we have compile bots for windows and mac that
Kimmo Kinnunen
2014/11/18 08:29:45
I know, but I don't have access to run the bots ma
scroggo
2014/11/18 16:52:23
That's annoying. Sorry, I didn't realize you could
| |
| 16 while (curr) { | 27 if ((codec = SkCreateImageEncoder_WIC(t)) != NULL) { |
| 17 if ((codec = curr->factory()(t)) != NULL) { | 28 return codec; |
| 18 return codec; | |
| 19 } | |
| 20 curr = curr->next(); | |
| 21 } | 29 } |
| 30 #endif | |
| 31 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | |
| 32 if ((codec = SkCreateImageEncoder_CG(t)) != NULL) { | |
| 33 return codec; | |
| 34 } | |
| 35 #endif | |
| 36 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUIL D_FOR_WIN) | |
| 37 if ((codec = SkCreatePNGImageEncoder(t)) != NULL) { | |
| 38 return codec; | |
| 39 } | |
| 40 #endif | |
| 41 if ((codec = SkCreateJPEGImageEncoder(t)) != NULL) { | |
| 42 return codec; | |
| 43 } | |
| 44 if ((codec = SkCreateWEBPImageEncoder(t)) != NULL) { | |
| 45 return codec; | |
| 46 } | |
| 47 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) | |
| 48 if ((codec = SkCreateKTXImageEncoder(t)) != NULL) { | |
| 49 return codec; | |
| 50 } | |
| 51 #endif | |
| 52 | |
| 22 return NULL; | 53 return NULL; |
| 23 } | 54 } |
| OLD | NEW |