| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 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 // We set rowsDecoded equal to the height because the background has alr
eady | 60 // We set rowsDecoded equal to the height because the background has alr
eady |
| 61 // been filled. RLE encodings sometimes skip pixels, so we always start
by | 61 // been filled. RLE encodings sometimes skip pixels, so we always start
by |
| 62 // filling the background. | 62 // filling the background. |
| 63 *rowsDecoded = dstInfo.height(); | 63 *rowsDecoded = dstInfo.height(); |
| 64 return kIncompleteInput; | 64 return kIncompleteInput; |
| 65 } | 65 } |
| 66 | 66 |
| 67 return kSuccess; | 67 return kSuccess; |
| 68 } | 68 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 fSampler.reset(new SkBmpRLESampler(this)); | 506 fSampler.reset(new SkBmpRLESampler(this)); |
| 507 } | 507 } |
| 508 | 508 |
| 509 return fSampler; | 509 return fSampler; |
| 510 } | 510 } |
| 511 | 511 |
| 512 int SkBmpRLECodec::setSampleX(int sampleX){ | 512 int SkBmpRLECodec::setSampleX(int sampleX){ |
| 513 fSampleX = sampleX; | 513 fSampleX = sampleX; |
| 514 return get_scaled_dimension(this->getInfo().width(), sampleX); | 514 return get_scaled_dimension(this->getInfo().width(), sampleX); |
| 515 } | 515 } |
| OLD | NEW |