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 "SkBmpStandardCodec.h" | 8 #include "SkBmpStandardCodec.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 if (!conversion_possible(dstInfo, this->getInfo())) { | 49 if (!conversion_possible(dstInfo, this->getInfo())) { |
50 SkCodecPrintf("Error: cannot convert input type to output type.\n"); | 50 SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
51 return kInvalidConversion; | 51 return kInvalidConversion; |
52 } | 52 } |
53 | 53 |
54 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); | 54 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); |
55 if (kSuccess != result) { | 55 if (kSuccess != result) { |
56 return result; | 56 return result; |
57 } | 57 } |
58 uint32_t rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); | 58 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); |
59 if (rows != dstInfo.height()) { | 59 if (rows != dstInfo.height()) { |
60 *rowsDecoded = rows; | 60 *rowsDecoded = rows; |
61 return kIncompleteInput; | 61 return kIncompleteInput; |
62 } | 62 } |
63 if (fInIco) { | 63 if (fInIco) { |
64 return this->decodeIcoMask(dstInfo, dst, dstRowBytes); | 64 return this->decodeIcoMask(dstInfo, dst, dstRowBytes); |
65 } | 65 } |
66 return kSuccess; | 66 return kSuccess; |
67 } | 67 } |
68 | 68 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 return kSuccess; | 289 return kSuccess; |
290 } | 290 } |
291 | 291 |
292 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType, SkAlphaType a
lphaType) const { | 292 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType, SkAlphaType a
lphaType) const { |
293 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 293 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
294 if (colorPtr) { | 294 if (colorPtr) { |
295 return get_color_table_fill_value(colorType, colorPtr, 0); | 295 return get_color_table_fill_value(colorType, colorPtr, 0); |
296 } | 296 } |
297 return INHERITED::onGetFillValue(colorType, alphaType); | 297 return INHERITED::onGetFillValue(colorType, alphaType); |
298 } | 298 } |
OLD | NEW |