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 "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 return true; | 91 return true; |
92 } | 92 } |
93 | 93 |
94 bool SkWbmpCodec::onRewind() { | 94 bool SkWbmpCodec::onRewind() { |
95 return read_header(this->stream(), nullptr); | 95 return read_header(this->stream(), nullptr); |
96 } | 96 } |
97 | 97 |
98 SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMC
olor* ctable, | 98 SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMC
olor* ctable, |
99 const Options& opts) { | 99 const Options& opts) { |
100 return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts); | 100 return SkSwizzler::CreateSwizzler(this->getEncodedInfo(), ctable, info, opts
); |
101 } | 101 } |
102 | 102 |
103 bool SkWbmpCodec::readRow(uint8_t* row) { | 103 bool SkWbmpCodec::readRow(uint8_t* row) { |
104 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes; | 104 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes; |
105 } | 105 } |
106 | 106 |
107 SkWbmpCodec::SkWbmpCodec(int width, int height, const SkEncodedInfo& info, SkStr
eam* stream) | 107 SkWbmpCodec::SkWbmpCodec(int width, int height, const SkEncodedInfo& info, SkStr
eam* stream) |
108 : INHERITED(width, height, info, stream) | 108 : INHERITED(width, height, info, stream) |
109 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width())) | 109 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width())) |
110 , fSwizzler(nullptr) | 110 , fSwizzler(nullptr) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 // Initialize the swizzler | 211 // Initialize the swizzler |
212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); | 212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); |
213 SkASSERT(fSwizzler); | 213 SkASSERT(fSwizzler); |
214 | 214 |
215 fSrcBuffer.reset(fSrcRowBytes); | 215 fSrcBuffer.reset(fSrcRowBytes); |
216 | 216 |
217 return kSuccess; | 217 return kSuccess; |
218 } | 218 } |
OLD | NEW |