Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: src/codec/SkScanlineDecoder.cpp

Issue 1305123002: Scanline decoding for gifs (Closed) Base URL: https://skia.googlesource.com/skia.git@real-bmp-scan
Patch Set: Compile fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkScaledCodec.cpp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
10 #include "SkCodec_libpng.h" 11 #include "SkCodec_libpng.h"
11 #include "SkCodec_wbmp.h" 12 #include "SkCodec_wbmp.h"
12 #include "SkCodecPriv.h" 13 #include "SkCodecPriv.h"
13 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK 14 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
14 #include "SkJpegCodec.h" 15 #include "SkJpegCodec.h"
15 #endif 16 #endif
16 17
17 struct DecoderProc { 18 struct DecoderProc {
18 bool (*IsFormat)(SkStream*); 19 bool (*IsFormat)(SkStream*);
19 SkScanlineDecoder* (*NewFromStream)(SkStream*); 20 SkScanlineDecoder* (*NewFromStream)(SkStream*);
20 }; 21 };
21 22
22 static const DecoderProc gDecoderProcs[] = { 23 static const DecoderProc gDecoderProcs[] = {
23 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream }, 24 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream },
24 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK 25 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
25 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream }, 26 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream },
26 #endif 27 #endif
28 { SkGifCodec::IsGif, SkGifCodec::NewSDFromStream },
27 { SkBmpCodec::IsBmp, SkBmpCodec::NewSDFromStream }, 29 { SkBmpCodec::IsBmp, SkBmpCodec::NewSDFromStream },
28 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream }, 30 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream },
29 }; 31 };
30 32
31 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) { 33 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) {
32 if (!stream) { 34 if (!stream) {
33 return nullptr; 35 return nullptr;
34 } 36 }
35 37
36 SkAutoTDelete<SkStream> streamDeleter(stream); 38 SkAutoTDelete<SkStream> streamDeleter(stream);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 fCurrScanline = 0; 99 fCurrScanline = 0;
98 fDstInfo = dstInfo; 100 fDstInfo = dstInfo;
99 fOptions = *options; 101 fOptions = *options;
100 return SkCodec::kSuccess; 102 return SkCodec::kSuccess;
101 } 103 }
102 104
103 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { 105 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) {
104 return this->start(dstInfo, nullptr, nullptr, nullptr); 106 return this->start(dstInfo, nullptr, nullptr, nullptr);
105 } 107 }
106 108
OLDNEW
« no previous file with comments | « src/codec/SkScaledCodec.cpp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698