| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 8 |
| 9 #include "VisualBench.h" | 9 #include "VisualBench.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #define HUMANIZE(time) humanize(time).c_str() | 50 #define HUMANIZE(time) humanize(time).c_str() |
| 51 | 51 |
| 52 VisualBench::VisualBench(void* hwnd, int argc, char** argv) | 52 VisualBench::VisualBench(void* hwnd, int argc, char** argv) |
| 53 : INHERITED(hwnd) | 53 : INHERITED(hwnd) |
| 54 , fCurrentSample(0) | 54 , fCurrentSample(0) |
| 55 , fCurrentFrame(0) | 55 , fCurrentFrame(0) |
| 56 , fFlushes(1) | 56 , fFlushes(1) |
| 57 , fLoops(1) | 57 , fLoops(1) |
| 58 , fState(kPreWarmLoops_State) | 58 , fState(kPreWarmLoops_State) |
| 59 , fBenchmark(NULL) | 59 , fBenchmark(NULL) |
| 60 , fResults(SkNEW(ResultsWriter)) { | 60 , fResults(new ResultsWriter) { |
| 61 SkCommandLineFlags::Parse(argc, argv); | 61 SkCommandLineFlags::Parse(argc, argv); |
| 62 | 62 |
| 63 this->setTitle(); | 63 this->setTitle(); |
| 64 this->setupBackend(); | 64 this->setupBackend(); |
| 65 | 65 |
| 66 fBenchmarkStream.reset(SkNEW(VisualBenchmarkStream)); | 66 fBenchmarkStream.reset(new VisualBenchmarkStream); |
| 67 | 67 |
| 68 // Print header | 68 // Print header |
| 69 SkDebugf("curr/maxrss\tloops\tflushes\tmin\tmedian\tmean\tmax\tstddev\tbench
\n"); | 69 SkDebugf("curr/maxrss\tloops\tflushes\tmin\tmedian\tmean\tmax\tstddev\tbench
\n"); |
| 70 | 70 |
| 71 // setup json logging if required | 71 // setup json logging if required |
| 72 if (!FLAGS_outResultsFile.isEmpty()) { | 72 if (!FLAGS_outResultsFile.isEmpty()) { |
| 73 fResults.reset(SkNEW(NanoJSONResultsWriter(FLAGS_outResultsFile[0]))); | 73 fResults.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0])); |
| 74 } | 74 } |
| 75 | 75 |
| 76 if (1 == FLAGS_properties.count() % 2) { | 76 if (1 == FLAGS_properties.count() % 2) { |
| 77 SkDebugf("ERROR: --properties must be passed with an even number of argu
ments.\n"); | 77 SkDebugf("ERROR: --properties must be passed with an even number of argu
ments.\n"); |
| 78 } else { | 78 } else { |
| 79 for (int i = 1; i < FLAGS_properties.count(); i += 2) { | 79 for (int i = 1; i < FLAGS_properties.count(); i += 2) { |
| 80 fResults->property(FLAGS_properties[i - 1], FLAGS_properties[i]); | 80 fResults->property(FLAGS_properties[i - 1], FLAGS_properties[i]); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 } | 83 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 void application_term() { | 350 void application_term() { |
| 351 SkEvent::Term(); | 351 SkEvent::Term(); |
| 352 SkGraphics::Term(); | 352 SkGraphics::Term(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 355 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 356 return new VisualBench(hwnd, argc, argv); | 356 return new VisualBench(hwnd, argc, argv); |
| 357 } | 357 } |
| 358 | 358 |
| OLD | NEW |