OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This small program is used to measure the performance of the various | 5 // This small program is used to measure the performance of the various |
6 // resize algorithms offered by the ImageOperations::Resize function. | 6 // resize algorithms offered by the ImageOperations::Resize function. |
7 // It will generate an empty source bitmap, and rescale it to specified | 7 // It will generate an empty source bitmap, and rescale it to specified |
8 // dimensions. It will repeat this operation multiple time to get more accurate | 8 // dimensions. It will repeat this operation multiple time to get more accurate |
9 // average throughput. Because it uses elapsed time to do its math, it is only | 9 // average throughput. Because it uses elapsed time to do its math, it is only |
10 // accurate on an idle system (but that approach was deemed more accurate | 10 // accurate on an idle system (but that approach was deemed more accurate |
11 // than the use of the times() call. | 11 // than the use of the times() call. |
12 // To present a single number in MB/s, it calculates the 'speed' by taking | 12 // To present a single number in MB/s, it calculates the 'speed' by taking |
13 // source surface + destination surface and dividing by the elapsed time. | 13 // source surface + destination surface and dividing by the elapsed time. |
14 // This number is somewhat reasonable way to measure this, given our current | 14 // This number is somewhat reasonable way to measure this, given our current |
15 // implementation which somewhat scales this way. | 15 // implementation which somewhat scales this way. |
16 | 16 |
17 #include <stdio.h> | 17 #include <stdio.h> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "base/format_macros.h" | 21 #include "base/format_macros.h" |
22 #include "base/string_number_conversions.h" | 22 #include "base/string_number_conversions.h" |
23 #include "base/string_split.h" | |
24 #include "base/string_util.h" | 23 #include "base/string_util.h" |
| 24 #include "base/strings/string_split.h" |
25 #include "base/time.h" | 25 #include "base/time.h" |
26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
27 #include "skia/ext/image_operations.h" | 27 #include "skia/ext/image_operations.h" |
28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
29 #include "third_party/skia/include/core/SkRect.h" | 29 #include "third_party/skia/include/core/SkRect.h" |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 struct StringMethodPair { | 33 struct StringMethodPair { |
34 const char* name; | 34 const char* name; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 return 1; | 284 return 1; |
285 } | 285 } |
286 | 286 |
287 if (!bench.Run()) { | 287 if (!bench.Run()) { |
288 printf("Failed to run benchmark\n"); | 288 printf("Failed to run benchmark\n"); |
289 return 1; | 289 return 1; |
290 } | 290 } |
291 | 291 |
292 return 0; | 292 return 0; |
293 } | 293 } |
OLD | NEW |