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 "SkBmpRLECodec.h" | 8 #include "SkBmpRLECodec.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo, | 37 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo, |
38 void* dst, size_t dstRowBytes, | 38 void* dst, size_t dstRowBytes, |
39 const Options& opts, | 39 const Options& opts, |
40 SkPMColor* inputColorPtr, | 40 SkPMColor* inputColorPtr, |
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 (!conversion_possible(dstInfo, this->getInfo())) { | 47 if (!conversion_possible_ignore_color_space(dstInfo, this->getInfo())) { |
48 SkCodecPrintf("Error: cannot convert input type to output type.\n"); | 48 SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
49 return kInvalidConversion; | 49 return kInvalidConversion; |
50 } | 50 } |
51 | 51 |
52 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); | 52 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol
orCount); |
53 if (kSuccess != result) { | 53 if (kSuccess != result) { |
54 return result; | 54 return result; |
55 } | 55 } |
56 | 56 |
57 // Perform the decode | 57 // Perform the decode |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 fSampler.reset(new SkBmpRLESampler(this)); | 547 fSampler.reset(new SkBmpRLESampler(this)); |
548 } | 548 } |
549 | 549 |
550 return fSampler; | 550 return fSampler; |
551 } | 551 } |
552 | 552 |
553 int SkBmpRLECodec::setSampleX(int sampleX){ | 553 int SkBmpRLECodec::setSampleX(int sampleX){ |
554 fSampleX = sampleX; | 554 fSampleX = sampleX; |
555 return get_scaled_dimension(this->getInfo().width(), sampleX); | 555 return get_scaled_dimension(this->getInfo().width(), sampleX); |
556 } | 556 } |
OLD | NEW |