| 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 "SkBmpMaskCodec.h" | 8 #include "SkBmpMaskCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| 11 | 11 |
| 12 /* | 12 /* |
| 13 * Creates an instance of the decoder | 13 * Creates an instance of the decoder |
| 14 */ | 14 */ |
| 15 SkBmpMaskCodec::SkBmpMaskCodec(const SkImageInfo& info, SkStream* stream, | 15 SkBmpMaskCodec::SkBmpMaskCodec(const SkImageInfo& info, SkStream* stream, |
| 16 uint16_t bitsPerPixel, SkMasks* masks, | 16 uint16_t bitsPerPixel, SkMasks* masks, |
| 17 SkScanlineDecoder::SkScanlineOrder rowOrder) | 17 SkCodec::SkScanlineOrder rowOrder) |
| 18 : INHERITED(info, stream, bitsPerPixel, rowOrder) | 18 : INHERITED(info, stream, bitsPerPixel, rowOrder) |
| 19 , fMasks(masks) | 19 , fMasks(masks) |
| 20 , fMaskSwizzler(nullptr) | 20 , fMaskSwizzler(nullptr) |
| 21 , fSrcRowBytes(SkAlign4(compute_row_bytes(this->getInfo().width(), this->bit
sPerPixel()))) | 21 , fSrcRowBytes(SkAlign4(compute_row_bytes(this->getInfo().width(), this->bit
sPerPixel()))) |
| 22 , fSrcBuffer(new uint8_t [fSrcRowBytes]) | 22 , fSrcBuffer(new uint8_t [fSrcRowBytes]) |
| 23 {} | 23 {} |
| 24 | 24 |
| 25 /* | 25 /* |
| 26 * Initiates the bitmap decode | 26 * Initiates the bitmap decode |
| 27 */ | 27 */ |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // Decode the row in destination format | 102 // Decode the row in destination format |
| 103 uint32_t row = this->getDstRow(y, height); | 103 uint32_t row = this->getDstRow(y, height); |
| 104 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); | 104 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
| 105 fMaskSwizzler->swizzle(dstRow, srcRow); | 105 fMaskSwizzler->swizzle(dstRow, srcRow); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Finished decoding the entire image | 108 // Finished decoding the entire image |
| 109 return kSuccess; | 109 return kSuccess; |
| 110 } | 110 } |
| OLD | NEW |