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 #ifndef SkCodec_DEFINED | 8 #ifndef SkCodec_DEFINED |
9 #define SkCodec_DEFINED | 9 #define SkCodec_DEFINED |
10 | 10 |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 */ | 506 */ |
507 | 507 |
508 /** | 508 /** |
509 * Most images types will be kTopDown and will not need to override this fu nction. | 509 * Most images types will be kTopDown and will not need to override this fu nction. |
510 */ | 510 */ |
511 virtual SkScanlineOrder onGetScanlineOrder() const { return kTopDown_SkScanl ineOrder; } | 511 virtual SkScanlineOrder onGetScanlineOrder() const { return kTopDown_SkScanl ineOrder; } |
512 | 512 |
513 /** | 513 /** |
514 * Update the next scanline. Used by interlaced png. | 514 * Update the next scanline. Used by interlaced png. |
515 */ | 515 */ |
516 void updateNextScanline(int newY) { fCurrScanline = newY; } | 516 void updateNextScanline(int newY) { fCurrScanline = newY; } |
scroggo
2015/12/02 15:24:41
Maybe this should be updateCurrScanline, to match
msarett
2015/12/02 15:45:05
Agreed.
| |
517 | 517 |
518 const SkImageInfo& dstInfo() const { return fDstInfo; } | 518 const SkImageInfo& dstInfo() const { return fDstInfo; } |
519 | 519 |
520 const SkCodec::Options& options() const { return fOptions; } | 520 const SkCodec::Options& options() const { return fOptions; } |
521 | 521 |
522 int currScanline() const { return fCurrScanline; } | |
scroggo
2015/12/02 15:24:41
Add some comments? We now have:
currScanline()
ne
msarett
2015/12/02 15:45:05
Yes this is confusing will do.
| |
523 | |
522 virtual int onOutputScanline(int inputScanline) const; | 524 virtual int onOutputScanline(int inputScanline) const; |
523 | 525 |
524 private: | 526 private: |
525 const SkImageInfo fSrcInfo; | 527 const SkImageInfo fSrcInfo; |
526 SkAutoTDelete<SkStream> fStream; | 528 SkAutoTDelete<SkStream> fStream; |
527 bool fNeedsRewind; | 529 bool fNeedsRewind; |
528 // These fields are only meaningful during scanline decodes. | 530 // These fields are only meaningful during scanline decodes. |
529 SkImageInfo fDstInfo; | 531 SkImageInfo fDstInfo; |
530 SkCodec::Options fOptions; | 532 SkCodec::Options fOptions; |
531 int fCurrScanline; | 533 int fCurrScanline; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 * May create a sampler, if one is not currently being used. Otherwise, doe s | 589 * May create a sampler, if one is not currently being used. Otherwise, doe s |
588 * not affect ownership. | 590 * not affect ownership. |
589 * | 591 * |
590 * Only valid during scanline decoding. | 592 * Only valid during scanline decoding. |
591 */ | 593 */ |
592 virtual SkSampler* getSampler(bool /*createIfNecessary*/) { return nullptr; } | 594 virtual SkSampler* getSampler(bool /*createIfNecessary*/) { return nullptr; } |
593 | 595 |
594 friend class SkSampledCodec; | 596 friend class SkSampledCodec; |
595 }; | 597 }; |
596 #endif // SkCodec_DEFINED | 598 #endif // SkCodec_DEFINED |
OLD | NEW |