| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 } | 706 } |
| 707 } | 707 } |
| 708 | 708 |
| 709 // Choose the candidate color types for image decoding | 709 // Choose the candidate color types for image decoding |
| 710 const SkColorType colorTypes[] = | 710 const SkColorType colorTypes[] = |
| 711 { kN32_SkColorType, | 711 { kN32_SkColorType, |
| 712 kRGB_565_SkColorType, | 712 kRGB_565_SkColorType, |
| 713 kAlpha_8_SkColorType, | 713 kAlpha_8_SkColorType, |
| 714 kIndex_8_SkColorType, | 714 kIndex_8_SkColorType, |
| 715 kGray_8_SkColorType }; | 715 kGray_8_SkColorType }; |
| 716 fColorTypes.push_back_n(SK_ARRAY_COUNT(colorTypes), colorTypes); | 716 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); |
| 717 } | 717 } |
| 718 | 718 |
| 719 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { | 719 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { |
| 720 // Not strictly necessary, as it will be checked again later, | 720 // Not strictly necessary, as it will be checked again later, |
| 721 // but helps to avoid a lot of pointless work if we're going to skip it. | 721 // but helps to avoid a lot of pointless work if we're going to skip it. |
| 722 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { | 722 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { |
| 723 return false; | 723 return false; |
| 724 } | 724 } |
| 725 | 725 |
| 726 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); | 726 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 kLastSingle_SubsetType = kBottomRight_SubsetType, | 1110 kLastSingle_SubsetType = kBottomRight_SubsetType, |
| 1111 }; | 1111 }; |
| 1112 | 1112 |
| 1113 const BenchRegistry* fBenches; | 1113 const BenchRegistry* fBenches; |
| 1114 const skiagm::GMRegistry* fGMs; | 1114 const skiagm::GMRegistry* fGMs; |
| 1115 SkIRect fClip; | 1115 SkIRect fClip; |
| 1116 SkTArray<SkScalar> fScales; | 1116 SkTArray<SkScalar> fScales; |
| 1117 SkTArray<SkString> fSKPs; | 1117 SkTArray<SkString> fSKPs; |
| 1118 SkTArray<bool> fUseMPDs; | 1118 SkTArray<bool> fUseMPDs; |
| 1119 SkTArray<SkString> fImages; | 1119 SkTArray<SkString> fImages; |
| 1120 SkTArray<SkColorType> fColorTypes; | 1120 SkTArray<SkColorType, true> fColorTypes; |
| 1121 SkScalar fZoomMax; | 1121 SkScalar fZoomMax; |
| 1122 double fZoomPeriodMs; | 1122 double fZoomPeriodMs; |
| 1123 | 1123 |
| 1124 double fSKPBytes, fSKPOps; | 1124 double fSKPBytes, fSKPOps; |
| 1125 | 1125 |
| 1126 const char* fSourceType; // What we're benching: bench, GM, SKP, ... | 1126 const char* fSourceType; // What we're benching: bench, GM, SKP, ... |
| 1127 const char* fBenchType; // How we bench it: micro, recording, playback, ..
. | 1127 const char* fBenchType; // How we bench it: micro, recording, playback, ..
. |
| 1128 int fCurrentRecording; | 1128 int fCurrentRecording; |
| 1129 int fCurrentScale; | 1129 int fCurrentScale; |
| 1130 int fCurrentSKP; | 1130 int fCurrentSKP; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 return 0; | 1365 return 0; |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 #if !defined SK_BUILD_FOR_IOS | 1368 #if !defined SK_BUILD_FOR_IOS |
| 1369 int main(int argc, char** argv) { | 1369 int main(int argc, char** argv) { |
| 1370 SkCommandLineFlags::Parse(argc, argv); | 1370 SkCommandLineFlags::Parse(argc, argv); |
| 1371 return nanobench_main(); | 1371 return nanobench_main(); |
| 1372 } | 1372 } |
| 1373 #endif | 1373 #endif |
| OLD | NEW |