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

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

Issue 1061713007: Adding png scanline decoding to kIndex8 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ctableCount requirements Created 5 years, 8 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
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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCodec_libbmp.h" 10 #include "SkCodec_libbmp.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // require a rewind. 83 // require a rewind.
84 const bool needsRewind = fNeedsRewind; 84 const bool needsRewind = fNeedsRewind;
85 fNeedsRewind = true; 85 fNeedsRewind = true;
86 if (!needsRewind) { 86 if (!needsRewind) {
87 return kNoRewindNecessary_RewindState; 87 return kNoRewindNecessary_RewindState;
88 } 88 }
89 return fStream->rewind() ? kRewound_RewindState 89 return fStream->rewind() ? kRewound_RewindState
90 : kCouldNotRewind_RewindState; 90 : kCouldNotRewind_RewindState;
91 } 91 }
92 92
93 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) { 93 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo, const Options* options,
94 fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo)); 94 SkPMColor ctable[], int* ctableCount) {
95
96 // Set options.
97 Options optsStorage;
98 if (NULL == options) {
99 options = &optsStorage;
100 }
101
102 fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo, *options, ctable, ctableCount));
95 return fScanlineDecoder.get(); 103 return fScanlineDecoder.get();
96 } 104 }
105
106 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
107 SkASSERT(kIndex_8_SkColorType != dstInfo.colorType());
108 if (kIndex_8_SkColorType == dstInfo.colorType()) {
109 return NULL;
110 }
111 return this->getScanlineDecoder(dstInfo, NULL, NULL, NULL);
112 }
OLDNEW
« include/codec/SkCodec.h ('K') | « include/codec/SkCodec.h ('k') | src/codec/SkCodecPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698