| 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 "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkColorTable.h" | 10 #include "SkColorTable.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 sk_memset32(colorPtr, 0xFF000000, maxColors); | 443 sk_memset32(colorPtr, 0xFF000000, maxColors); |
| 444 } | 444 } |
| 445 | 445 |
| 446 fColorTable.reset(new SkColorTable(colorPtr, maxColors)); | 446 fColorTable.reset(new SkColorTable(colorPtr, maxColors)); |
| 447 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount)
; | 447 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount)
; |
| 448 } | 448 } |
| 449 | 449 |
| 450 SkCodec::Result SkGifCodec::prepareToDecode(const SkImageInfo& dstInfo, SkPMColo
r* inputColorPtr, | 450 SkCodec::Result SkGifCodec::prepareToDecode(const SkImageInfo& dstInfo, SkPMColo
r* inputColorPtr, |
| 451 int* inputColorCount, const Options& opts) { | 451 int* inputColorCount, const Options& opts) { |
| 452 // Check for valid input parameters | 452 // Check for valid input parameters |
| 453 if (!conversion_possible(dstInfo, this->getInfo())) { | 453 if (!legacy_conversion_possible(dstInfo, this->getInfo())) { |
| 454 return gif_error("Cannot convert input type to output type.\n", | 454 return gif_error("Cannot convert input type to output type.\n", kInvalid
Conversion); |
| 455 kInvalidConversion); | |
| 456 } | 455 } |
| 457 | 456 |
| 458 // Initialize color table and copy to the client if necessary | 457 // Initialize color table and copy to the client if necessary |
| 459 this->initializeColorTable(dstInfo, inputColorPtr, inputColorCount); | 458 this->initializeColorTable(dstInfo, inputColorPtr, inputColorCount); |
| 460 | 459 |
| 461 this->initializeSwizzler(dstInfo, opts); | 460 this->initializeSwizzler(dstInfo, opts); |
| 462 return kSuccess; | 461 return kSuccess; |
| 463 } | 462 } |
| 464 | 463 |
| 465 void SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& o
pts) { | 464 void SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& o
pts) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 int SkGifCodec::onOutputScanline(int inputScanline) const { | 597 int SkGifCodec::onOutputScanline(int inputScanline) const { |
| 599 if (fGif->Image.Interlace) { | 598 if (fGif->Image.Interlace) { |
| 600 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { | 599 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { |
| 601 return inputScanline; | 600 return inputScanline; |
| 602 } | 601 } |
| 603 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + | 602 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + |
| 604 fFrameRect.top(); | 603 fFrameRect.top(); |
| 605 } | 604 } |
| 606 return inputScanline; | 605 return inputScanline; |
| 607 } | 606 } |
| OLD | NEW |