OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "BenchLogger.h" | 8 #include "BenchLogger.h" |
9 #include "Timer.h" | 9 #include "Timer.h" |
10 #include "CopyTilesRenderer.h" | 10 #include "CopyTilesRenderer.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 if (NULL == picture.get()) { | 198 if (NULL == picture.get()) { |
199 SkString err; | 199 SkString err; |
200 err.printf("Could not read an SkPicture from %s\n", inputPath.c_str()); | 200 err.printf("Could not read an SkPicture from %s\n", inputPath.c_str()); |
201 gLogger.logError(err); | 201 gLogger.logError(err); |
202 return false; | 202 return false; |
203 } | 203 } |
204 | 204 |
205 SkString filename = SkOSPath::Basename(inputPath.c_str()); | 205 SkString filename = SkOSPath::Basename(inputPath.c_str()); |
206 | 206 |
207 gWriter.bench(filename.c_str(), | 207 gWriter.bench(filename.c_str(), |
208 SkScalarCeilToInt(picture->cullRect().width()), | 208 SkScalarCeilToInt(picture->cullRect().width()), |
209 SkScalarCeilToInt(picture->cullRect().height())); | 209 SkScalarCeilToInt(picture->cullRect().height())); |
210 | 210 |
211 benchmark.run(picture, FLAGS_mpd); | 211 benchmark.run(picture, FLAGS_mpd); |
212 | 212 |
213 #if SK_LAZY_CACHE_STATS | 213 #if SK_LAZY_CACHE_STATS |
214 if (FLAGS_trackDeferredCaching) { | 214 if (FLAGS_trackDeferredCaching) { |
215 int cacheHits = pool->getCacheHits(); | 215 int cacheHits = pool->getCacheHits(); |
216 int cacheMisses = pool->getCacheMisses(); | 216 int cacheMisses = pool->getCacheMisses(); |
217 pool->resetCacheHitsAndMisses(); | 217 pool->resetCacheHitsAndMisses(); |
218 SkString hitString; | 218 SkString hitString; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 FLAGS_buildNumber, | 437 FLAGS_buildNumber, |
438 FLAGS_timestamp, | 438 FLAGS_timestamp, |
439 FLAGS_gitHash[0], | 439 FLAGS_gitHash[0], |
440 FLAGS_gitNumber))); | 440 FLAGS_gitNumber))); |
441 gWriter.add(jsonWriter.get()); | 441 gWriter.add(jsonWriter.get()); |
442 } | 442 } |
443 | 443 |
444 gWriter.add(&gLogWriter); | 444 gWriter.add(&gLogWriter); |
445 | 445 |
446 | 446 |
447 #if SK_ENABLE_INST_COUNT | |
448 gPrintInstCount = true; | |
449 #endif | |
450 SkAutoGraphics ag; | 447 SkAutoGraphics ag; |
451 | 448 |
452 sk_tools::PictureBenchmark benchmark; | 449 sk_tools::PictureBenchmark benchmark; |
453 | 450 |
454 setup_benchmark(&benchmark); | 451 setup_benchmark(&benchmark); |
455 | 452 |
456 int failures = 0; | 453 int failures = 0; |
457 for (int i = 0; i < FLAGS_readPath.count(); ++i) { | 454 for (int i = 0; i < FLAGS_readPath.count(); ++i) { |
458 failures += process_input(FLAGS_readPath[i], benchmark); | 455 failures += process_input(FLAGS_readPath[i], benchmark); |
459 } | 456 } |
(...skipping 19 matching lines...) Expand all Loading... |
479 | 476 |
480 gWriter.end(); | 477 gWriter.end(); |
481 return 0; | 478 return 0; |
482 } | 479 } |
483 | 480 |
484 #if !defined SK_BUILD_FOR_IOS | 481 #if !defined SK_BUILD_FOR_IOS |
485 int main(int argc, char * const argv[]) { | 482 int main(int argc, char * const argv[]) { |
486 return tool_main(argc, (char**) argv); | 483 return tool_main(argc, (char**) argv); |
487 } | 484 } |
488 #endif | 485 #endif |
OLD | NEW |