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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 513 |
514 // FIXME: This is similar to the implementation for bmp and png. Can we share m
ore code or | 514 // FIXME: This is similar to the implementation for bmp and png. Can we share m
ore code or |
515 // possibly make this non-virtual? | 515 // possibly make this non-virtual? |
516 uint32_t SkGifCodec::onGetFillValue(SkColorType colorType) const { | 516 uint32_t SkGifCodec::onGetFillValue(SkColorType colorType) const { |
517 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 517 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
518 return get_color_table_fill_value(colorType, colorPtr, fFillIndex); | 518 return get_color_table_fill_value(colorType, colorPtr, fFillIndex); |
519 } | 519 } |
520 | 520 |
521 SkCodec::Result SkGifCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, | 521 SkCodec::Result SkGifCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
522 const SkCodec::Options& opts, SkPMColor inputColorPtr[], int* inputColor
Count) { | 522 const SkCodec::Options& opts, SkPMColor inputColorPtr[], int* inputColor
Count) { |
523 return this->prepareToDecode(dstInfo, inputColorPtr, inputColorCount, this->
options()); | 523 return this->prepareToDecode(dstInfo, inputColorPtr, inputColorCount, opts); |
524 } | 524 } |
525 | 525 |
526 void SkGifCodec::handleScanlineFrame(int count, int* rowsBeforeFrame, int* rowsI
nFrame) { | 526 void SkGifCodec::handleScanlineFrame(int count, int* rowsBeforeFrame, int* rowsI
nFrame) { |
527 if (fFrameIsSubset) { | 527 if (fFrameIsSubset) { |
528 const int currRow = this->currScanline(); | 528 const int currRow = this->currScanline(); |
529 | 529 |
530 // The number of rows that remain to be skipped before reaching rows tha
t we | 530 // The number of rows that remain to be skipped before reaching rows tha
t we |
531 // actually must decode into. | 531 // actually must decode into. |
532 // This must be at least zero. We also make sure that it is less than o
r | 532 // This must be at least zero. We also make sure that it is less than o
r |
533 // equal to count, since we will skip at most count rows. | 533 // equal to count, since we will skip at most count rows. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 int SkGifCodec::onOutputScanline(int inputScanline) const { | 598 int SkGifCodec::onOutputScanline(int inputScanline) const { |
599 if (fGif->Image.Interlace) { | 599 if (fGif->Image.Interlace) { |
600 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { | 600 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { |
601 return inputScanline; | 601 return inputScanline; |
602 } | 602 } |
603 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + | 603 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + |
604 fFrameRect.top(); | 604 fFrameRect.top(); |
605 } | 605 } |
606 return inputScanline; | 606 return inputScanline; |
607 } | 607 } |
OLD | NEW |