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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "Resources.h" | 9 #include "Resources.h" |
10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 if (fMode == kAnimated_Mode) { | 714 if (fMode == kAnimated_Mode) { |
715 // We'll draw one of each frame, so make it big enough to hold them all. | 715 // We'll draw one of each frame, so make it big enough to hold them all. |
716 const size_t count = codec->getFrameInfo().size(); | 716 const size_t count = codec->getFrameInfo().size(); |
717 imageSize.fHeight = imageSize.fHeight * count; | 717 imageSize.fHeight = imageSize.fHeight * count; |
718 } | 718 } |
719 return imageSize; | 719 return imageSize; |
720 } | 720 } |
721 | 721 |
722 Name CodecSrc::name() const { | 722 Name CodecSrc::name() const { |
723 if (1.0f == fScale) { | 723 if (1.0f == fScale) { |
724 return SkOSPath::Basename(fPath.c_str()); | 724 Name name = SkOSPath::Basename(fPath.c_str()); |
| 725 if (fMode == kAnimated_Mode) { |
| 726 name.append("_animated"); |
| 727 } |
| 728 return name; |
725 } | 729 } |
| 730 SkASSERT(fMode != kAnimated_Mode); |
726 return get_scaled_name(fPath, fScale); | 731 return get_scaled_name(fPath, fScale); |
727 } | 732 } |
728 | 733 |
729 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 734 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
730 | 735 |
731 AndroidCodecSrc::AndroidCodecSrc(Path path, CodecSrc::DstColorType dstColorType, | 736 AndroidCodecSrc::AndroidCodecSrc(Path path, CodecSrc::DstColorType dstColorType, |
732 SkAlphaType dstAlphaType, int sampleSize) | 737 SkAlphaType dstAlphaType, int sampleSize) |
733 : fPath(path) | 738 : fPath(path) |
734 , fDstColorType(dstColorType) | 739 , fDstColorType(dstColorType) |
735 , fDstAlphaType(dstAlphaType) | 740 , fDstAlphaType(dstAlphaType) |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 Error err = src.draw(&rec); | 1772 Error err = src.draw(&rec); |
1768 if (!err.isEmpty()) { | 1773 if (!err.isEmpty()) { |
1769 return err; | 1774 return err; |
1770 } | 1775 } |
1771 dl->draw(canvas); | 1776 dl->draw(canvas); |
1772 return check_against_reference(bitmap, src, fSink); | 1777 return check_against_reference(bitmap, src, fSink); |
1773 }); | 1778 }); |
1774 } | 1779 } |
1775 | 1780 |
1776 } // namespace DM | 1781 } // namespace DM |
OLD | NEW |