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 && |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return !decoder->failed(); | 302 return !decoder->failed(); |
303 } | 303 } |
304 | 304 |
305 int main(int argc, char* argv[]) { | 305 int main(int argc, char* argv[]) { |
306 base::CommandLine::Init(argc, argv); | 306 base::CommandLine::Init(argc, argv); |
307 | 307 |
308 // If the platform supports color correction, allow it to be controlled. | 308 // If the platform supports color correction, allow it to be controlled. |
309 | 309 |
310 bool applyColorCorrection = false; | 310 bool applyColorCorrection = false; |
311 | 311 |
312 #if USE(SKCOLORXFORM) | 312 #if USE(QCMSLIB) |
313 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) | 313 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) |
314 applyColorCorrection = (--argc, ++argv, true); | 314 applyColorCorrection = (--argc, ++argv, true); |
315 | 315 |
316 if (argc < 2) { | 316 if (argc < 2) { |
317 fprintf(stderr, | 317 fprintf(stderr, |
318 "Usage: %s [--color-correct] file [iterations] [packetSize]\n", | 318 "Usage: %s [--color-correct] file [iterations] [packetSize]\n", |
319 argv[0]); | 319 argv[0]); |
320 exit(1); | 320 exit(1); |
321 } | 321 } |
322 #else | 322 #else |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 exit(3); | 399 exit(3); |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 // Results to stdout. | 403 // Results to stdout. |
404 | 404 |
405 double averageTime = totalTime / static_cast<double>(iterations); | 405 double averageTime = totalTime / static_cast<double>(iterations); |
406 printf("%f %f\n", totalTime, averageTime); | 406 printf("%f %f\n", totalTime, averageTime); |
407 return 0; | 407 return 0; |
408 } | 408 } |
OLD | NEW |