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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkBmpMaskCodec.h" | 9 #include "SkBmpMaskCodec.h" |
10 #include "SkBmpRLECodec.h" | 10 #include "SkBmpRLECodec.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 } | 618 } |
619 | 619 |
620 SkScanlineOrder onGetScanlineOrder() const override { | 620 SkScanlineOrder onGetScanlineOrder() const override { |
621 if (SkBmpCodec::kTopDown_RowOrder == fCodec->fRowOrder) { | 621 if (SkBmpCodec::kTopDown_RowOrder == fCodec->fRowOrder) { |
622 return kTopDown_SkScanlineOrder; | 622 return kTopDown_SkScanlineOrder; |
623 } else { | 623 } else { |
624 return kOutOfOrder_SkScanlineOrder; | 624 return kOutOfOrder_SkScanlineOrder; |
625 } | 625 } |
626 } | 626 } |
627 | 627 |
628 int onGetY() const override { | 628 int onGetY() override { |
629 return fCodec->getDstRow(INHERITED::onGetY(), this->dstInfo().height()); | 629 return fCodec->getDstRow(INHERITED::onGetY(), this->dstInfo().height()); |
630 } | 630 } |
631 | 631 |
632 // TODO(msarett): Override default skipping with something more clever. | 632 // TODO(msarett): Override default skipping with something more clever. |
633 // TODO(msarett): Consider other optimizations for this codec. | 633 // TODO(msarett): Consider other optimizations for this codec. |
634 | 634 |
635 private: | 635 private: |
636 SkAutoTDelete<SkBmpCodec> fCodec; | 636 SkAutoTDelete<SkBmpCodec> fCodec; |
637 | 637 |
638 typedef SkScanlineDecoder INHERITED; | 638 typedef SkScanlineDecoder INHERITED; |
639 }; | 639 }; |
640 | 640 |
641 SkScanlineDecoder* SkBmpCodec::NewSDFromStream(SkStream* stream) { | 641 SkScanlineDecoder* SkBmpCodec::NewSDFromStream(SkStream* stream) { |
642 SkAutoTDelete<SkBmpCodec> codec(static_cast<SkBmpCodec*>(SkBmpCodec::NewFrom
Stream(stream))); | 642 SkAutoTDelete<SkBmpCodec> codec(static_cast<SkBmpCodec*>(SkBmpCodec::NewFrom
Stream(stream))); |
643 if (!codec) { | 643 if (!codec) { |
644 return NULL; | 644 return NULL; |
645 } | 645 } |
646 | 646 |
647 return SkNEW_ARGS(SkBmpScanlineDecoder, (codec.detach())); | 647 return SkNEW_ARGS(SkBmpScanlineDecoder, (codec.detach())); |
648 } | 648 } |
OLD | NEW |