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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 canvas->ref(); | 815 canvas->ref(); |
816 break; | 816 break; |
817 } | 817 } |
818 case kNormal_benchModes: | 818 case kNormal_benchModes: |
819 canvas = new SkCanvas(device); | 819 canvas = new SkCanvas(device); |
820 break; | 820 break; |
821 default: | 821 default: |
822 SkASSERT(0); | 822 SkASSERT(0); |
823 } | 823 } |
824 device->unref(); | 824 device->unref(); |
| 825 canvas->clear(SK_ColorWHITE); |
825 } | 826 } |
826 SkAutoUnref canvasUnref(canvas); | 827 SkAutoUnref canvasUnref(canvas); |
827 | 828 |
828 if (NULL != canvas) { | 829 if (NULL != canvas) { |
829 if (doClip) { | 830 if (doClip) { |
830 performClip(canvas, dim.fX, dim.fY); | 831 performClip(canvas, dim.fX, dim.fY); |
831 } | 832 } |
832 if (doScale) { | 833 if (doScale) { |
833 performScale(canvas, dim.fX, dim.fY); | 834 performScale(canvas, dim.fX, dim.fY); |
834 } | 835 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 if (repeatDraw > 1) { | 922 if (repeatDraw > 1) { |
922 SkString result = timerData.getResult(logPerIter, printMin, repe
atDraw, configName, | 923 SkString result = timerData.getResult(logPerIter, printMin, repe
atDraw, configName, |
923 timerWall, truncatedTimerW
all, timerCpu, | 924 timerWall, truncatedTimerW
all, timerCpu, |
924 truncatedTimerCpu, | 925 truncatedTimerCpu, |
925 timerGpu && NULL != contex
t); | 926 timerGpu && NULL != contex
t); |
926 logger.logProgress(result); | 927 logger.logProgress(result); |
927 } | 928 } |
928 if (outDir.size() > 0 && kNonRendering_Backend != backend) { | 929 if (outDir.size() > 0 && kNonRendering_Backend != backend) { |
929 saveFile(bench->getName(), configName, outDir.c_str(), | 930 saveFile(bench->getName(), configName, outDir.c_str(), |
930 device->accessBitmap(false)); | 931 device->accessBitmap(false)); |
931 canvas->clear(SK_ColorWHITE); | |
932 } | 932 } |
933 } | 933 } |
934 if (loggedBenchStart) { | 934 if (loggedBenchStart) { |
935 logger.logProgress(SkString("\n")); | 935 logger.logProgress(SkString("\n")); |
936 } | 936 } |
937 } | 937 } |
938 #if SK_SUPPORT_GPU | 938 #if SK_SUPPORT_GPU |
939 #if GR_CACHE_STATS | 939 #if GR_CACHE_STATS |
940 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { | 940 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { |
941 GrContextFactory::GLContextType ctxType = (GrContextFactory::GLContextTy
pe)i; | 941 GrContextFactory::GLContextType ctxType = (GrContextFactory::GLContextTy
pe)i; |
(...skipping 13 matching lines...) Expand all Loading... |
955 } | 955 } |
956 | 956 |
957 return 0; | 957 return 0; |
958 } | 958 } |
959 | 959 |
960 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 960 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
961 int main(int argc, char * const argv[]) { | 961 int main(int argc, char * const argv[]) { |
962 return tool_main(argc, (char**) argv); | 962 return tool_main(argc, (char**) argv); |
963 } | 963 } |
964 #endif | 964 #endif |
OLD | NEW |