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

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

Issue 1489163002: Add currScanline() getter to SkCodec API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change comments in SkCodec.h Created 5 years 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 | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.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 "SkCodec_libgif.h" 8 #include "SkCodec_libgif.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 return get_color_table_fill_value(colorType, colorPtr, fFillIndex); 501 return get_color_table_fill_value(colorType, colorPtr, fFillIndex);
502 } 502 }
503 503
504 SkCodec::Result SkGifCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, 504 SkCodec::Result SkGifCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
505 const SkCodec::Options& opts, SkPMColor inputColorPtr[], int* inputColor Count) { 505 const SkCodec::Options& opts, SkPMColor inputColorPtr[], int* inputColor Count) {
506 return this->prepareToDecode(dstInfo, inputColorPtr, inputColorCount, this-> options()); 506 return this->prepareToDecode(dstInfo, inputColorPtr, inputColorCount, this-> options());
507 } 507 }
508 508
509 void SkGifCodec::handleScanlineFrame(int count, int* rowsBeforeFrame, int* rowsI nFrame) { 509 void SkGifCodec::handleScanlineFrame(int count, int* rowsBeforeFrame, int* rowsI nFrame) {
510 if (fFrameIsSubset) { 510 if (fFrameIsSubset) {
511 const int currRow = this->INHERITED::nextScanline(); 511 const int currRow = this->currScanline();
512 512
513 // The number of rows that remain to be skipped before reaching rows tha t we 513 // The number of rows that remain to be skipped before reaching rows tha t we
514 // actually must decode into. 514 // actually must decode into.
515 // This must be at least zero. We also make sure that it is less than o r 515 // This must be at least zero. We also make sure that it is less than o r
516 // equal to count, since we will skip at most count rows. 516 // equal to count, since we will skip at most count rows.
517 *rowsBeforeFrame = SkTMin(count, SkTMax(0, fFrameRect.top() - currRow)); 517 *rowsBeforeFrame = SkTMin(count, SkTMax(0, fFrameRect.top() - currRow));
518 518
519 // Rows left to decode once we reach the start of the frame. 519 // Rows left to decode once we reach the start of the frame.
520 const int rowsLeft = count - *rowsBeforeFrame; 520 const int rowsLeft = count - *rowsBeforeFrame;
521 521
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 int SkGifCodec::onOutputScanline(int inputScanline) const { 582 int SkGifCodec::onOutputScanline(int inputScanline) const {
583 if (fGif->Image.Interlace) { 583 if (fGif->Image.Interlace) {
584 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott om()) { 584 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott om()) {
585 return inputScanline; 585 return inputScanline;
586 } 586 }
587 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram eRect.height()) + 587 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram eRect.height()) +
588 fFrameRect.top(); 588 fFrameRect.top();
589 } 589 }
590 return inputScanline; 590 return inputScanline;
591 } 591 }
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698