| 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(int width, int height, const SkEncodedInfo& info,
SkStream* stream, | 15 SkBmpMaskCodec::SkBmpMaskCodec(const SkImageInfo& info, SkStream* stream, |
| 16 uint16_t bitsPerPixel, SkMasks* masks, | 16 uint16_t bitsPerPixel, SkMasks* masks, |
| 17 SkCodec::SkScanlineOrder rowOrder) | 17 SkCodec::SkScanlineOrder rowOrder) |
| 18 : INHERITED(width, height, info, stream, bitsPerPixel, rowOrder) | 18 : INHERITED(info, stream, bitsPerPixel, rowOrder) |
| 19 , fMasks(masks) | 19 , fMasks(masks) |
| 20 , fMaskSwizzler(nullptr) | 20 , fMaskSwizzler(nullptr) |
| 21 , fSrcBuffer(new uint8_t [this->srcRowBytes()]) | 21 , fSrcBuffer(new uint8_t [this->srcRowBytes()]) |
| 22 {} | 22 {} |
| 23 | 23 |
| 24 /* | 24 /* |
| 25 * Initiates the bitmap decode | 25 * Initiates the bitmap decode |
| 26 */ | 26 */ |
| 27 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, | 27 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, |
| 28 void* dst, size_t dstRowBytes, | 28 void* dst, size_t dstRowBytes, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Decode the row in destination format | 86 // Decode the row in destination format |
| 87 uint32_t row = this->getDstRow(y, height); | 87 uint32_t row = this->getDstRow(y, height); |
| 88 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); | 88 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
| 89 fMaskSwizzler->swizzle(dstRow, srcRow); | 89 fMaskSwizzler->swizzle(dstRow, srcRow); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Finished decoding the entire image | 92 // Finished decoding the entire image |
| 93 return height; | 93 return height; |
| 94 } | 94 } |
| OLD | NEW |