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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 exit(1); | 349 exit(1); |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 // Create a web platform without V8. | 353 // Create a web platform without V8. |
354 | 354 |
355 class WebPlatform : public blink::Platform { | 355 class WebPlatform : public blink::Platform { |
356 public: | 356 public: |
357 void screenColorProfile(WebVector<char>* profile) override | 357 void screenColorProfile(WebVector<char>* profile) override |
358 { | 358 { |
359 getScreenColorProfile(profile); // Returns a whacked color profile. | 359 getScreenColorProfile(profile); // Returns a color spin color profil
e. |
360 } | 360 } |
361 }; | 361 }; |
362 | 362 |
363 Platform::initialize(new WebPlatform()); | 363 Platform::initialize(new WebPlatform()); |
364 | 364 |
365 // Read entire file content to data, and consolidate the SharedBuffer data | 365 // Read entire file content to data, and consolidate the SharedBuffer data |
366 // segments into one, contiguous block of memory. | 366 // segments into one, contiguous block of memory. |
367 | 367 |
368 RefPtr<SharedBuffer> data = readFile(argv[1]); | 368 RefPtr<SharedBuffer> data = readFile(argv[1]); |
369 if (!data.get() || !data->size()) { | 369 if (!data.get() || !data->size()) { |
(...skipping 24 matching lines...) Expand all Loading... |
394 exit(3); | 394 exit(3); |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 // Results to stdout. | 398 // Results to stdout. |
399 | 399 |
400 double averageTime = totalTime / static_cast<double>(iterations); | 400 double averageTime = totalTime / static_cast<double>(iterations); |
401 printf("%f %f\n", totalTime, averageTime); | 401 printf("%f %f\n", totalTime, averageTime); |
402 return 0; | 402 return 0; |
403 } | 403 } |
OLD | NEW |