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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 // record timer values for each repeat, and their sum | 908 // record timer values for each repeat, and their sum |
909 TimerData timerData(perIterTimeformat, normalTimeFormat); | 909 TimerData timerData(perIterTimeformat, normalTimeFormat); |
910 for (int i = 0; i < repeatDraw; i++) { | 910 for (int i = 0; i < repeatDraw; i++) { |
911 if ((benchMode == kRecord_benchModes || benchMode == kPictureRec
ord_benchModes)) { | 911 if ((benchMode == kRecord_benchModes || benchMode == kPictureRec
ord_benchModes)) { |
912 // This will clear the recorded commands so that they do not | 912 // This will clear the recorded commands so that they do not |
913 // accumulate. | 913 // accumulate. |
914 canvas = pictureRecordTo.beginRecording(dim.fX, dim.fY, | 914 canvas = pictureRecordTo.beginRecording(dim.fX, dim.fY, |
915 SkPicture::kUsePathBoundsForClip_RecordingFlag); | 915 SkPicture::kUsePathBoundsForClip_RecordingFlag); |
916 } | 916 } |
917 | 917 |
918 timer->start(); | 918 timer->start(bench->getDurationScale()); |
919 if (NULL != canvas) { | 919 if (NULL != canvas) { |
920 canvas->save(); | 920 canvas->save(); |
921 } | 921 } |
922 if (benchMode == kPictureRecord_benchModes) { | 922 if (benchMode == kPictureRecord_benchModes) { |
923 pictureRecordFrom.draw(canvas); | 923 pictureRecordFrom.draw(canvas); |
924 } else { | 924 } else { |
925 bench->draw(canvas); | 925 bench->draw(canvas); |
926 } | 926 } |
927 | 927 |
928 if (kDeferredSilent_benchModes == benchMode) { | 928 if (kDeferredSilent_benchModes == benchMode) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 } | 987 } |
988 | 988 |
989 return 0; | 989 return 0; |
990 } | 990 } |
991 | 991 |
992 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 992 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
993 int main(int argc, char * const argv[]) { | 993 int main(int argc, char * const argv[]) { |
994 return tool_main(argc, (char**) argv); | 994 return tool_main(argc, (char**) argv); |
995 } | 995 } |
996 #endif | 996 #endif |
OLD | NEW |