OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "BenchTimer.h" | 10 #include "BenchTimer.h" |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 SK_GL(*glContext, Finish()); | 916 SK_GL(*glContext, Finish()); |
917 } | 917 } |
918 #endif | 918 #endif |
919 // stop the inclusive and gpu timers once all the GL calls | 919 // stop the inclusive and gpu timers once all the GL calls |
920 // have completed | 920 // have completed |
921 timer->end(); | 921 timer->end(); |
922 | 922 |
923 SkAssertResult(timerData.appendTimes(timer)); | 923 SkAssertResult(timerData.appendTimes(timer)); |
924 | 924 |
925 } | 925 } |
926 if (repeatDraw > 1) { | 926 const char* timeFormat; |
927 const char* timeFormat; | 927 if (repeatDraw > 1 && TimerData::kPerIter_Result == timerResult)
{ |
928 if (TimerData::kPerIter_Result == timerResult) { | 928 timeFormat = perIterTimeformat.c_str(); |
929 timeFormat = perIterTimeformat.c_str(); | 929 } else { |
930 } else { | 930 timeFormat = normalTimeFormat.c_str(); |
931 timeFormat = normalTimeFormat.c_str(); | |
932 } | |
933 uint32_t filteredTimerTypes = timerTypes; | |
934 if (NULL == context) { | |
935 filteredTimerTypes &= ~TimerData::kGpu_Flag; | |
936 } | |
937 SkString result = timerData.getResult(timeFormat, | |
938 timerResult, | |
939 configName, | |
940 filteredTimerTypes); | |
941 logger.logProgress(result); | |
942 } | 931 } |
| 932 uint32_t filteredTimerTypes = timerTypes; |
| 933 if (NULL == context) { |
| 934 filteredTimerTypes &= ~TimerData::kGpu_Flag; |
| 935 } |
| 936 SkString result = timerData.getResult(timeFormat, |
| 937 timerResult, |
| 938 configName, |
| 939 filteredTimerTypes); |
| 940 logger.logProgress(result); |
| 941 |
943 if (outDir.size() > 0 && kNonRendering_Backend != backend) { | 942 if (outDir.size() > 0 && kNonRendering_Backend != backend) { |
944 saveFile(bench->getName(), configName, outDir.c_str(), | 943 saveFile(bench->getName(), configName, outDir.c_str(), |
945 device->accessBitmap(false)); | 944 device->accessBitmap(false)); |
946 } | 945 } |
947 } | 946 } |
948 } | 947 } |
949 if (loggedBenchStart) { | 948 if (loggedBenchStart) { |
950 logger.logProgress(SkString("\n")); | 949 logger.logProgress(SkString("\n")); |
951 } | 950 } |
952 } | 951 } |
(...skipping 17 matching lines...) Expand all Loading... |
970 } | 969 } |
971 | 970 |
972 return 0; | 971 return 0; |
973 } | 972 } |
974 | 973 |
975 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 974 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
976 int main(int argc, char * const argv[]) { | 975 int main(int argc, char * const argv[]) { |
977 return tool_main(argc, (char**) argv); | 976 return tool_main(argc, (char**) argv); |
978 } | 977 } |
979 #endif | 978 #endif |
OLD | NEW |