| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 * @param numRepeats The number of times to repeat the draw. | 60 * @param numRepeats The number of times to repeat the draw. |
| 61 * @param timer The timer used to benchmark the work. | 61 * @param timer The timer used to benchmark the work. |
| 62 */ | 62 */ |
| 63 static void do_benchmark_work(sk_tools::PictureRenderer* renderer, | 63 static void do_benchmark_work(sk_tools::PictureRenderer* renderer, |
| 64 BBoxType bBoxType, | 64 BBoxType bBoxType, |
| 65 SkPicture* pic, | 65 SkPicture* pic, |
| 66 const int numRepeats, | 66 const int numRepeats, |
| 67 BenchTimer* timer) { | 67 BenchTimer* timer) { |
| 68 renderer->setBBoxHierarchyType(bBoxType); | 68 renderer->setBBoxHierarchyType(bBoxType); |
| 69 renderer->setGridSize(FLAGS_tilesize, FLAGS_tilesize); | 69 renderer->setGridSize(FLAGS_tilesize, FLAGS_tilesize); |
| 70 renderer->init(pic, NULL, NULL, false); | 70 renderer->init(pic, NULL, NULL, NULL, false); |
| 71 | 71 |
| 72 SkDebugf("%s %d times...\n", renderer->getConfigName().c_str(), numRepeats); | 72 SkDebugf("%s %d times...\n", renderer->getConfigName().c_str(), numRepeats); |
| 73 for (int i = 0; i < numRepeats; ++i) { | 73 for (int i = 0; i < numRepeats; ++i) { |
| 74 renderer->setup(); | 74 renderer->setup(); |
| 75 // Render once to fill caches | 75 // Render once to fill caches |
| 76 renderer->render(); | 76 renderer->render(); |
| 77 // Render again to measure | 77 // Render again to measure |
| 78 timer->start(); | 78 timer->start(); |
| 79 renderer->render(); | 79 renderer->render(); |
| 80 timer->end(); | 80 timer->end(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); | 186 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); |
| 187 return 0; | 187 return 0; |
| 188 } | 188 } |
| 189 | 189 |
| 190 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 190 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 191 int main(int argc, char** argv) { | 191 int main(int argc, char** argv) { |
| 192 return tool_main(argc, argv); | 192 return tool_main(argc, argv); |
| 193 } | 193 } |
| 194 #endif | 194 #endif |
| OLD | NEW |