| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts); | 85 return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts); |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool SkWbmpCodec::readRow(uint8_t* row) { | 88 bool SkWbmpCodec::readRow(uint8_t* row) { |
| 89 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes; | 89 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes; |
| 90 } | 90 } |
| 91 | 91 |
| 92 SkWbmpCodec::SkWbmpCodec(const SkImageInfo& info, SkStream* stream) | 92 SkWbmpCodec::SkWbmpCodec(const SkImageInfo& info, SkStream* stream) |
| 93 : INHERITED(info, stream) | 93 : INHERITED(info, stream) |
| 94 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width())) | 94 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width())) |
| 95 , fSwizzler(nullptr) |
| 95 , fColorTable(nullptr) | 96 , fColorTable(nullptr) |
| 96 , fSwizzler(nullptr) | |
| 97 {} | 97 {} |
| 98 | 98 |
| 99 SkEncodedFormat SkWbmpCodec::onGetEncodedFormat() const { | 99 SkEncodedFormat SkWbmpCodec::onGetEncodedFormat() const { |
| 100 return kWBMP_SkEncodedFormat; | 100 return kWBMP_SkEncodedFormat; |
| 101 } | 101 } |
| 102 | 102 |
| 103 SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, | 103 SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, |
| 104 void* dst, | 104 void* dst, |
| 105 size_t rowBytes, | 105 size_t rowBytes, |
| 106 const Options& options, | 106 const Options& options, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Initialize the swizzler | 189 // Initialize the swizzler |
| 190 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); | 190 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); |
| 191 if (nullptr == fSwizzler.get()) { | 191 if (nullptr == fSwizzler.get()) { |
| 192 return kInvalidConversion; | 192 return kInvalidConversion; |
| 193 } | 193 } |
| 194 | 194 |
| 195 fSrcBuffer.reset(fSrcRowBytes); | 195 fSrcBuffer.reset(fSrcRowBytes); |
| 196 | 196 |
| 197 return kSuccess; | 197 return kSuccess; |
| 198 } | 198 } |
| OLD | NEW |