OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 const SkImageGenerator::Result result = codec->getPixels( | 654 const SkImageGenerator::Result result = codec->getPixels( |
655 bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); | 655 bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); |
656 switch (result) { | 656 switch (result) { |
657 case SkImageGenerator::kSuccess: | 657 case SkImageGenerator::kSuccess: |
658 case SkImageGenerator::kIncompleteInput: | 658 case SkImageGenerator::kIncompleteInput: |
659 return new CodecBench(SkOSPath::Basename(path.c_str()), | 659 return new CodecBench(SkOSPath::Basename(path.c_str()), |
660 encoded, colorType); | 660 encoded, colorType); |
661 case SkImageGenerator::kInvalidConversion: | 661 case SkImageGenerator::kInvalidConversion: |
662 // This is okay. Not all conversions are valid. | 662 // This is okay. Not all conversions are valid. |
663 break; | 663 break; |
664 case SkImageGenerator::kCouldNotRewind: | |
665 // FIXME: This is due to a bug in some implementations | |
666 // of SkCodec. All should support rewinding. | |
667 break; | |
668 default: | 664 default: |
669 // This represents some sort of failure. | 665 // This represents some sort of failure. |
670 SkASSERT(false); | 666 SkASSERT(false); |
671 break; | 667 break; |
672 } | 668 } |
673 } | 669 } |
674 fCurrentColorType = 0; | 670 fCurrentColorType = 0; |
675 } | 671 } |
676 | 672 |
677 // Run the DecodingBenches | 673 // Run the DecodingBenches |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 975 |
980 return 0; | 976 return 0; |
981 } | 977 } |
982 | 978 |
983 #if !defined SK_BUILD_FOR_IOS | 979 #if !defined SK_BUILD_FOR_IOS |
984 int main(int argc, char** argv) { | 980 int main(int argc, char** argv) { |
985 SkCommandLineFlags::Parse(argc, argv); | 981 SkCommandLineFlags::Parse(argc, argv); |
986 return nanobench_main(); | 982 return nanobench_main(); |
987 } | 983 } |
988 #endif | 984 #endif |
OLD | NEW |