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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 return SkCodec::kInvalidInput; | 280 return SkCodec::kInvalidInput; |
281 } | 281 } |
282 | 282 |
283 // Copy the color table to the client if necessary | 283 // Copy the color table to the client if necessary |
284 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount)
; | 284 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount)
; |
285 | 285 |
286 // Initialize a buffer for encoded RLE data | 286 // Initialize a buffer for encoded RLE data |
287 fRLEBytes = fOrigRLEBytes; | 287 fRLEBytes = fOrigRLEBytes; |
288 if (!this->initializeStreamBuffer()) { | 288 if (!this->initializeStreamBuffer()) { |
289 SkCodecPrintf("Error: cannot initialize stream buffer.\n"); | 289 SkCodecPrintf("Error: cannot initialize stream buffer.\n"); |
290 return SkCodec::kInvalidConversion; | 290 return SkCodec::kInvalidInput; |
291 } | 291 } |
292 | 292 |
293 return SkCodec::kSuccess; | 293 return SkCodec::kSuccess; |
294 } | 294 } |
295 | 295 |
296 /* | 296 /* |
297 * Performs the bitmap decoding for RLE input format | 297 * Performs the bitmap decoding for RLE input format |
298 * RLE decoding is performed all at once, rather than a one row at a time | 298 * RLE decoding is performed all at once, rather than a one row at a time |
299 */ | 299 */ |
300 int SkBmpRLECodec::decodeRows(const SkImageInfo& info, void* dst, size_t dstRowB
ytes, | 300 int SkBmpRLECodec::decodeRows(const SkImageInfo& info, void* dst, size_t dstRowB
ytes, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 fSampler.reset(new SkBmpRLESampler(this)); | 539 fSampler.reset(new SkBmpRLESampler(this)); |
540 } | 540 } |
541 | 541 |
542 return fSampler; | 542 return fSampler; |
543 } | 543 } |
544 | 544 |
545 int SkBmpRLECodec::setSampleX(int sampleX){ | 545 int SkBmpRLECodec::setSampleX(int sampleX){ |
546 fSampleX = sampleX; | 546 fSampleX = sampleX; |
547 return get_scaled_dimension(this->getInfo().width(), sampleX); | 547 return get_scaled_dimension(this->getInfo().width(), sampleX); |
548 } | 548 } |
OLD | NEW |