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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 // Initialize color table and copy to the client if necessary | 457 // Initialize color table and copy to the client if necessary |
458 this->initializeColorTable(dstInfo, inputColorPtr, inputColorCount); | 458 this->initializeColorTable(dstInfo, inputColorPtr, inputColorCount); |
459 | 459 |
460 this->initializeSwizzler(dstInfo, opts); | 460 this->initializeSwizzler(dstInfo, opts); |
461 return kSuccess; | 461 return kSuccess; |
462 } | 462 } |
463 | 463 |
464 void SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& o
pts) { | 464 void SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& o
pts) { |
465 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 465 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
466 const SkIRect* frameRect = fFrameIsSubset ? &fFrameRect : nullptr; | 466 const SkIRect* frameRect = fFrameIsSubset ? &fFrameRect : nullptr; |
467 fSwizzler.reset(SkSwizzler::CreateSwizzler(SkSwizzler::kIndex, colorPtr, dst
Info, opts, | 467 fSwizzler.reset(SkSwizzler::CreateSwizzler(this->getEncodedInfo(), colorPtr,
dstInfo, opts, |
468 frameRect)); | 468 frameRect)); |
469 SkASSERT(fSwizzler); | 469 SkASSERT(fSwizzler); |
470 } | 470 } |
471 | 471 |
472 bool SkGifCodec::readRow() { | 472 bool SkGifCodec::readRow() { |
473 return GIF_ERROR != DGifGetLine(fGif, fSrcBuffer.get(), fFrameRect.width()); | 473 return GIF_ERROR != DGifGetLine(fGif, fSrcBuffer.get(), fFrameRect.width()); |
474 } | 474 } |
475 | 475 |
476 /* | 476 /* |
477 * Initiates the gif decode | 477 * Initiates the gif decode |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 int SkGifCodec::onOutputScanline(int inputScanline) const { | 597 int SkGifCodec::onOutputScanline(int inputScanline) const { |
598 if (fGif->Image.Interlace) { | 598 if (fGif->Image.Interlace) { |
599 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { | 599 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { |
600 return inputScanline; | 600 return inputScanline; |
601 } | 601 } |
602 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + | 602 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + |
603 fFrameRect.top(); | 603 fFrameRect.top(); |
604 } | 604 } |
605 return inputScanline; | 605 return inputScanline; |
606 } | 606 } |
OLD | NEW |