OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "BenchTimer.h" | 8 #include "BenchTimer.h" |
9 #include "LazyDecodeBitmap.h" | 9 #include "LazyDecodeBitmap.h" |
10 #include "PictureBenchmark.h" | 10 #include "PictureBenchmark.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 } | 303 } |
304 | 304 |
305 SkScalar cpuTime = SkDoubleToScalar(atof(timerResult.c_str() + pos + sizeof(
findStr) - 1)); | 305 SkScalar cpuTime = SkDoubleToScalar(atof(timerResult.c_str() + pos + sizeof(
findStr) - 1)); |
306 if (cpuTime == 0) { // atof returns 0.0 on error. | 306 if (cpuTime == 0) { // atof returns 0.0 on error. |
307 SkDebugf("Unable to read value from timer result.\n"); | 307 SkDebugf("Unable to read value from timer result.\n"); |
308 return false; | 308 return false; |
309 } | 309 } |
310 return true; | 310 return true; |
311 } | 311 } |
312 | 312 |
313 static int tool_main(int argc, char** argv) { | 313 int tool_main(int argc, char** argv); |
| 314 int tool_main(int argc, char** argv) { |
314 SkAutoGraphics ag; | 315 SkAutoGraphics ag; |
315 SkString usage; | 316 SkString usage; |
316 usage.printf("Usage: filename [filename]*\n"); | 317 usage.printf("Usage: filename [filename]*\n"); |
317 | 318 |
318 if (argc < 2) { | 319 if (argc < 2) { |
319 SkDebugf("%s\n", usage.c_str()); | 320 SkDebugf("%s\n", usage.c_str()); |
320 return -1; | 321 return -1; |
321 } | 322 } |
322 | 323 |
323 Histogram* histograms[kNumBenchmarks]; | 324 Histogram* histograms[kNumBenchmarks]; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 pbLine.appendf("\n"); | 373 pbLine.appendf("\n"); |
373 recLine.appendf("\n"); | 374 recLine.appendf("\n"); |
374 playbackOut.writeText(pbLine.c_str()); | 375 playbackOut.writeText(pbLine.c_str()); |
375 recordOut.writeText(recLine.c_str()); | 376 recordOut.writeText(recLine.c_str()); |
376 } | 377 } |
377 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); | 378 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); |
378 | 379 |
379 return 0; | 380 return 0; |
380 } | 381 } |
381 | 382 |
| 383 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
382 int main(int argc, char** argv) { | 384 int main(int argc, char** argv) { |
383 return tool_main(argc, argv); | 385 return tool_main(argc, argv); |
384 } | 386 } |
| 387 #endif |
385 | 388 |
| 389 |
OLD | NEW |