Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: src/codec/SkGifCodec.cpp

Issue 1911613002: Use SkEncodedInfo in place of SkSwizzler::SrcConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bmp bug Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkBmpStandardCodec.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpStandardCodec.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698