OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Provides a minimal wrapping of the Blink image decoders. Used to perform | 5 // Provides a minimal wrapping of the Blink image decoders. Used to perform |
6 // a non-threaded, memory-to-memory image decode using micro second accuracy | 6 // a non-threaded, memory-to-memory image decode using micro second accuracy |
7 // clocks to measure image decode time. Optionally applies color correction | 7 // clocks to measure image decode time. Optionally applies color correction |
8 // during image decoding on supported platforms (default off). Usage: | 8 // during image decoding on supported platforms (default off). Usage: |
9 // | 9 // |
10 // % ninja -C out/Release image_decode_bench && | 10 // % ninja -C out/Release image_decode_bench && |
11 // ./out/Release/image_decode_bench file [iterations] | 11 // ./out/Release/image_decode_bench file [iterations] |
12 // | 12 // |
13 // TODO(noel): Consider adding md5 checksum support to WTF. Use it to compute | 13 // TODO(noel): Consider adding md5 checksum support to WTF. Use it to compute |
14 // the decoded image frame md5 and output that value. | 14 // the decoded image frame md5 and output that value. |
15 // | 15 // |
16 // TODO(noel): Consider integrating this tool in Chrome telemetry for realz, | 16 // TODO(noel): Consider integrating this tool in Chrome telemetry for realz, |
17 // using the image corpii used to assess Blink image decode performance. Refer | 17 // using the image corpii used to assess Blink image decode performance. Refer |
18 // to http://crbug.com/398235#c103 and http://crbug.com/258324#c5 | 18 // to http://crbug.com/398235#c103 and http://crbug.com/258324#c5 |
19 | 19 |
| 20 #include <memory> |
20 #include "base/command_line.h" | 21 #include "base/command_line.h" |
21 #include "platform/SharedBuffer.h" | 22 #include "platform/SharedBuffer.h" |
22 #include "platform/image-decoders/ImageDecoder.h" | 23 #include "platform/image-decoders/ImageDecoder.h" |
23 #include "public/platform/Platform.h" | 24 #include "public/platform/Platform.h" |
24 #include "ui/gfx/test/icc_profiles.h" | 25 #include "ui/gfx/test/icc_profiles.h" |
25 #include "wtf/PassRefPtr.h" | 26 #include "wtf/PassRefPtr.h" |
26 #include "wtf/PtrUtil.h" | 27 #include "wtf/PtrUtil.h" |
27 #include <memory> | |
28 | 28 |
29 #if defined(_WIN32) | 29 #if defined(_WIN32) |
30 #include <mmsystem.h> | 30 #include <mmsystem.h> |
31 #include <sys/stat.h> | 31 #include <sys/stat.h> |
32 #include <time.h> | 32 #include <time.h> |
33 #define stat(x, y) _stat(x, y) | 33 #define stat(x, y) _stat(x, y) |
34 typedef struct _stat sttype; | 34 typedef struct _stat sttype; |
35 #else | 35 #else |
36 #include <sys/stat.h> | 36 #include <sys/stat.h> |
37 #include <sys/time.h> | 37 #include <sys/time.h> |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 double averageTime = totalTime / static_cast<double>(iterations); | 345 double averageTime = totalTime / static_cast<double>(iterations); |
346 printf("%f %f\n", totalTime, averageTime); | 346 printf("%f %f\n", totalTime, averageTime); |
347 return 0; | 347 return 0; |
348 } | 348 } |
349 | 349 |
350 } // namespace blink | 350 } // namespace blink |
351 | 351 |
352 int main(int argc, char* argv[]) { | 352 int main(int argc, char* argv[]) { |
353 return blink::main(argc, argv); | 353 return blink::main(argc, argv); |
354 } | 354 } |
OLD | NEW |