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 30 matching lines...) Expand all Loading... |
41 int* inputColorCount, | 41 int* inputColorCount, |
42 int* rowsDecoded) { | 42 int* rowsDecoded) { |
43 if (opts.fSubset) { | 43 if (opts.fSubset) { |
44 // Subsets are not supported. | 44 // Subsets are not supported. |
45 return kUnimplemented; | 45 return kUnimplemented; |
46 } | 46 } |
47 if (dstInfo.dimensions() != this->getInfo().dimensions()) { | 47 if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
48 SkCodecPrintf("Error: scaling not supported.\n"); | 48 SkCodecPrintf("Error: scaling not supported.\n"); |
49 return kInvalidScale; | 49 return kInvalidScale; |
50 } | 50 } |
51 if (!conversion_possible(dstInfo, this->getInfo())) { | 51 if (!conversion_possible_ignore_color_space(dstInfo, this->getInfo())) { |
52 SkCodecPrintf("Error: cannot convert input type to output type.\n"); | 52 SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
53 return kInvalidConversion; | 53 return kInvalidConversion; |
54 } | 54 } |
55 | 55 |
56 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); | 56 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); |
57 if (kSuccess != result) { | 57 if (kSuccess != result) { |
58 return result; | 58 return result; |
59 } | 59 } |
60 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); | 60 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); |
61 if (rows != dstInfo.height()) { | 61 if (rows != dstInfo.height()) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { | 305 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { |
306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
307 if (colorPtr) { | 307 if (colorPtr) { |
308 return get_color_table_fill_value(colorType, colorPtr, 0); | 308 return get_color_table_fill_value(colorType, colorPtr, 0); |
309 } | 309 } |
310 return INHERITED::onGetFillValue(colorType); | 310 return INHERITED::onGetFillValue(colorType); |
311 } | 311 } |
OLD | NEW |