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 "Timer.h" | 8 #include "Timer.h" |
9 #include "Benchmark.h" | 9 #include "Benchmark.h" |
10 #include "LazyDecodeBitmap.h" | 10 #include "LazyDecodeBitmap.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 * This function is the sink to which all work ends up going. | 53 * This function is the sink to which all work ends up going. |
54 * @param renderer The renderer to use to perform the work. | 54 * @param renderer The renderer to use to perform the work. |
55 * To measure rendering, use a TiledPictureRenderer. | 55 * To measure rendering, use a TiledPictureRenderer. |
56 * To measure recording, use a RecordPictureRenderer. | 56 * To measure recording, use a RecordPictureRenderer. |
57 * @param bBoxType The bounding box hierarchy type to use. | 57 * @param bBoxType The bounding box hierarchy type to use. |
58 * @param pic The picture to draw to the renderer. | 58 * @param pic The picture to draw to the renderer. |
59 * @param numRepeats The number of times to repeat the draw. | 59 * @param numRepeats The number of times to repeat the draw. |
60 * @param timer The timer used to benchmark the work. | 60 * @param timer The timer used to benchmark the work. |
61 */ | 61 */ |
62 static void do_benchmark_work(sk_tools::PictureRenderer* renderer, | 62 static void do_benchmark_work(sk_tools::PictureRenderer* renderer, |
63 BBoxType bBoxType, | 63 BBoxType bBoxType, |
64 SkPicture* pic, | 64 SkPicture* pic, |
65 const int numRepeats, | 65 const int numRepeats, |
66 Timer* timer) { | 66 Timer* timer) { |
67 renderer->setBBoxHierarchyType(bBoxType); | 67 renderer->setBBoxHierarchyType(bBoxType); |
68 renderer->setGridSize(FLAGS_tilesize, FLAGS_tilesize); | 68 renderer->setGridSize(FLAGS_tilesize, FLAGS_tilesize); |
69 renderer->init(pic, NULL, NULL, NULL, false); | 69 renderer->init(pic, NULL, NULL, NULL, false, false); |
70 | 70 |
71 SkDebugf("%s %d times...\n", renderer->getConfigName().c_str(), numRepeats); | 71 SkDebugf("%s %d times...\n", renderer->getConfigName().c_str(), numRepeats); |
72 for (int i = 0; i < numRepeats; ++i) { | 72 for (int i = 0; i < numRepeats; ++i) { |
73 renderer->setup(); | 73 renderer->setup(); |
74 // Render once to fill caches | 74 // Render once to fill caches |
75 renderer->render(); | 75 renderer->render(); |
76 // Render again to measure | 76 // Render again to measure |
77 timer->start(); | 77 timer->start(); |
78 renderer->render(); | 78 renderer->render(); |
79 timer->end(); | 79 timer->end(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); | 195 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); |
196 return 0; | 196 return 0; |
197 } | 197 } |
198 | 198 |
199 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 199 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
200 int main(int argc, char** argv) { | 200 int main(int argc, char** argv) { |
201 return tool_main(argc, argv); | 201 return tool_main(argc, argv); |
202 } | 202 } |
203 #endif | 203 #endif |
OLD | NEW |