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 21 matching lines...) Expand all Loading... |
32 int* rowsDecoded) { | 32 int* rowsDecoded) { |
33 if (opts.fSubset) { | 33 if (opts.fSubset) { |
34 // Subsets are not supported. | 34 // Subsets are not supported. |
35 return kUnimplemented; | 35 return kUnimplemented; |
36 } | 36 } |
37 if (dstInfo.dimensions() != this->getInfo().dimensions()) { | 37 if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
38 SkCodecPrintf("Error: scaling not supported.\n"); | 38 SkCodecPrintf("Error: scaling not supported.\n"); |
39 return kInvalidScale; | 39 return kInvalidScale; |
40 } | 40 } |
41 | 41 |
42 if (!conversion_possible_ignore_color_space(dstInfo, this->getInfo())) { | 42 if (!conversion_possible(dstInfo, this->getInfo())) { |
43 SkCodecPrintf("Error: cannot convert input type to output type.\n"); | 43 SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
44 return kInvalidConversion; | 44 return kInvalidConversion; |
45 } | 45 } |
46 | 46 |
47 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); | 47 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); |
48 if (kSuccess != result) { | 48 if (kSuccess != result) { |
49 return result; | 49 return result; |
50 } | 50 } |
51 | 51 |
52 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); | 52 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); |
(...skipping 32 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 |