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

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

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors 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') | src/codec/SkSwizzler.h » ('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 "SkCodec_libpng.h" 10 #include "SkCodec_libpng.h"
10 #include "SkCodec_wbmp.h" 11 #include "SkCodec_wbmp.h"
11 #include "SkCodecPriv.h" 12 #include "SkCodecPriv.h"
12 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK 13 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
13 #include "SkJpegCodec.h" 14 #include "SkJpegCodec.h"
14 #endif 15 #endif
15 16
16 struct DecoderProc { 17 struct DecoderProc {
17 bool (*IsFormat)(SkStream*); 18 bool (*IsFormat)(SkStream*);
18 SkScanlineDecoder* (*NewFromStream)(SkStream*); 19 SkScanlineDecoder* (*NewFromStream)(SkStream*);
19 }; 20 };
20 21
21 static const DecoderProc gDecoderProcs[] = { 22 static const DecoderProc gDecoderProcs[] = {
22 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream }, 23 { SkPngCodec::IsPng, SkPngCodec::NewSDFromStream },
23 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK 24 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
24 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream }, 25 { SkJpegCodec::IsJpeg, SkJpegCodec::NewSDFromStream },
25 #endif 26 #endif
27 { SkBmpCodec::IsBmp, SkBmpCodec::NewSDFromStream },
26 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream }, 28 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewSDFromStream },
27 }; 29 };
28 30
29 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) { 31 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) {
30 if (!stream) { 32 if (!stream) {
31 return nullptr; 33 return nullptr;
32 } 34 }
33 35
34 SkAutoTDelete<SkStream> streamDeleter(stream); 36 SkAutoTDelete<SkStream> streamDeleter(stream);
35 37
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 options = &optsStorage; 89 options = &optsStorage;
88 } 90 }
89 91
90 const SkCodec::Result result = this->onStart(dstInfo, *options, ctable, ctab leCount); 92 const SkCodec::Result result = this->onStart(dstInfo, *options, ctable, ctab leCount);
91 if (result != SkCodec::kSuccess) { 93 if (result != SkCodec::kSuccess) {
92 return result; 94 return result;
93 } 95 }
94 96
95 fCurrScanline = 0; 97 fCurrScanline = 0;
96 fDstInfo = dstInfo; 98 fDstInfo = dstInfo;
99 fOptions = *options;
97 return SkCodec::kSuccess; 100 return SkCodec::kSuccess;
98 } 101 }
99 102
100 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { 103 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) {
101 return this->start(dstInfo, nullptr, nullptr, nullptr); 104 return this->start(dstInfo, nullptr, nullptr, nullptr);
102 } 105 }
103 106
OLDNEW
« no previous file with comments | « src/codec/SkScaledCodec.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698