| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 if (!conversion_possible(dstInfo, this->getInfo())) { | 43 if (!conversion_possible(dstInfo, this->getInfo())) { |
| 44 SkCodecPrintf("Error: cannot convert input type to output type.\n"); | 44 SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
| 45 return kInvalidConversion; | 45 return kInvalidConversion; |
| 46 } | 46 } |
| 47 | 47 |
| 48 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); | 48 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); |
| 49 if (kSuccess != result) { | 49 if (kSuccess != result) { |
| 50 return result; | 50 return result; |
| 51 } | 51 } |
| 52 | 52 |
| 53 uint32_t rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); | 53 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); |
| 54 if (rows != dstInfo.height()) { | 54 if (rows != dstInfo.height()) { |
| 55 *rowsDecoded = rows; | 55 *rowsDecoded = rows; |
| 56 return kIncompleteInput; | 56 return kIncompleteInput; |
| 57 } | 57 } |
| 58 return kSuccess; | 58 return kSuccess; |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool SkBmpMaskCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Option
s& options) { | 61 bool SkBmpMaskCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Option
s& options) { |
| 62 // Create the swizzler | 62 // Create the swizzler |
| 63 fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(dstInfo, this->getInf
o(), fMasks, | 63 fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(dstInfo, this->getInf
o(), fMasks, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // Decode the row in destination format | 100 // Decode the row in destination format |
| 101 uint32_t row = this->getDstRow(y, height); | 101 uint32_t row = this->getDstRow(y, height); |
| 102 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); | 102 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
| 103 fMaskSwizzler->swizzle(dstRow, srcRow); | 103 fMaskSwizzler->swizzle(dstRow, srcRow); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // Finished decoding the entire image | 106 // Finished decoding the entire image |
| 107 return height; | 107 return height; |
| 108 } | 108 } |
| OLD | NEW |