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 "SkScanlineDecoder.h" | 8 #include "SkScanlineDecoder.h" |
9 #include "SkBmpCodec.h" | 9 #include "SkBmpCodec.h" |
10 #include "SkCodec_libgif.h" | |
11 #include "SkCodec_libpng.h" | 10 #include "SkCodec_libpng.h" |
12 #include "SkCodec_wbmp.h" | 11 #include "SkCodec_wbmp.h" |
13 #include "SkCodecPriv.h" | 12 #include "SkCodecPriv.h" |
14 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK | 13 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
15 #include "SkJpegCodec.h" | 14 #include "SkJpegCodec.h" |
16 #endif | 15 #endif |
17 | 16 |
18 struct DecoderProc { | 17 struct DecoderProc { |
19 bool (*IsFormat)(SkStream*); | 18 bool (*IsFormat)(SkStream*); |
20 SkScanlineDecoder* (*NewFromStream)(SkStream*); | 19 SkScanlineDecoder* (*NewFromStream)(SkStream*); |
21 }; | 20 }; |
22 | 21 |
23 static const DecoderProc gDecoderProcs[] = { | 22 static const DecoderProc gDecoderProcs[] = { |
24 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream }, | 23 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream }, |
25 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK | 24 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
26 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream }, | 25 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream }, |
27 #endif | 26 #endif |
28 { SkGifCodec::IsGif, SkGifCodec::NewSDFromStream }, | |
29 { SkBmpCodec::IsBmp, SkBmpCodec::NewSDFromStream }, | 27 { SkBmpCodec::IsBmp, SkBmpCodec::NewSDFromStream }, |
30 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream }, | 28 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream }, |
31 }; | 29 }; |
32 | 30 |
33 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) { | 31 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) { |
34 if (!stream) { | 32 if (!stream) { |
35 return nullptr; | 33 return nullptr; |
36 } | 34 } |
37 | 35 |
38 SkAutoTDelete<SkStream> streamDeleter(stream); | 36 SkAutoTDelete<SkStream> streamDeleter(stream); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 fCurrScanline = 0; | 97 fCurrScanline = 0; |
100 fDstInfo = dstInfo; | 98 fDstInfo = dstInfo; |
101 fOptions = *options; | 99 fOptions = *options; |
102 return SkCodec::kSuccess; | 100 return SkCodec::kSuccess; |
103 } | 101 } |
104 | 102 |
105 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { | 103 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { |
106 return this->start(dstInfo, nullptr, nullptr, nullptr); | 104 return this->start(dstInfo, nullptr, nullptr, nullptr); |
107 } | 105 } |
108 | 106 |
OLD | NEW |