OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkCodec_libbmp.h" | 10 #include "SkCodec_libbmp.h" |
11 #include "SkCodec_libgif.h" | 11 #include "SkCodec_libgif.h" |
12 #include "SkCodec_libico.h" | 12 #include "SkCodec_libico.h" |
13 #include "SkCodec_libpng.h" | 13 #include "SkCodec_libpng.h" |
14 #include "SkCodec_wbmp.h" | 14 #include "SkCodec_wbmp.h" |
15 #include "SkCodecPriv.h" | 15 #include "SkCodecPriv.h" |
| 16 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
16 #include "SkJpegCodec.h" | 17 #include "SkJpegCodec.h" |
| 18 #endif |
17 #include "SkStream.h" | 19 #include "SkStream.h" |
18 #include "SkWebpCodec.h" | 20 #include "SkWebpCodec.h" |
19 | 21 |
20 struct DecoderProc { | 22 struct DecoderProc { |
21 bool (*IsFormat)(SkStream*); | 23 bool (*IsFormat)(SkStream*); |
22 SkCodec* (*NewFromStream)(SkStream*); | 24 SkCodec* (*NewFromStream)(SkStream*); |
23 }; | 25 }; |
24 | 26 |
25 static const DecoderProc gDecoderProcs[] = { | 27 static const DecoderProc gDecoderProcs[] = { |
26 { SkPngCodec::IsPng, SkPngCodec::NewFromStream }, | 28 { SkPngCodec::IsPng, SkPngCodec::NewFromStream }, |
| 29 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
27 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream }, | 30 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream }, |
| 31 #endif |
28 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream }, | 32 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream }, |
29 { SkGifCodec::IsGif, SkGifCodec::NewFromStream }, | 33 { SkGifCodec::IsGif, SkGifCodec::NewFromStream }, |
30 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream }, | 34 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream }, |
31 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream }, | 35 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream }, |
32 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream } | 36 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream } |
33 }; | 37 }; |
34 | 38 |
35 SkCodec* SkCodec::NewFromStream(SkStream* stream) { | 39 SkCodec* SkCodec::NewFromStream(SkStream* stream) { |
36 if (!stream) { | 40 if (!stream) { |
37 return NULL; | 41 return NULL; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return fScanlineDecoder.get(); | 106 return fScanlineDecoder.get(); |
103 } | 107 } |
104 | 108 |
105 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) { | 109 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) { |
106 SkASSERT(kIndex_8_SkColorType != dstInfo.colorType()); | 110 SkASSERT(kIndex_8_SkColorType != dstInfo.colorType()); |
107 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 111 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
108 return NULL; | 112 return NULL; |
109 } | 113 } |
110 return this->getScanlineDecoder(dstInfo, NULL, NULL, NULL); | 114 return this->getScanlineDecoder(dstInfo, NULL, NULL, NULL); |
111 } | 115 } |
OLD | NEW |