| 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 #ifdef WTF | 5 #ifdef WTF |
| 6 | 6 |
| 7 Provides a minimal wrapping of the Blink image decoders. Used to perform | 7 Provides a minimal wrapping of the Blink image decoders. Used to perform |
| 8 a non-threaded, memory-to-memory image decode using micro second accuracy | 8 a non-threaded, memory-to-memory image decode using micro second accuracy |
| 9 clocks to measure image decode time. Optionally applies color correction | 9 clocks to measure image decode time. Optionally applies color correction |
| 10 during image decoding on supported platforms (default off). Usage: | 10 during image decoding on supported platforms (default off). Usage: |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // Create a web platform without V8. | 360 // Create a web platform without V8. |
| 361 | 361 |
| 362 class WebPlatform : public TestingPlatformSupport { | 362 class WebPlatform : public TestingPlatformSupport { |
| 363 public: | 363 public: |
| 364 void screenColorProfile(WebVector<char>* profile) override | 364 void screenColorProfile(WebVector<char>* profile) override |
| 365 { | 365 { |
| 366 getScreenColorProfile(profile); // Returns a whacked color profile. | 366 getScreenColorProfile(profile); // Returns a whacked color profile. |
| 367 } | 367 } |
| 368 }; | 368 }; |
| 369 | 369 |
| 370 blink::initializeWithoutV8(new WebPlatform()); | 370 Platform::initialize(new WebPlatform()); |
| 371 | 371 |
| 372 // Set image decoding Platform options. | 372 // Set image decoding Platform options. |
| 373 | 373 |
| 374 #if USE(QCMSLIB) | 374 #if USE(QCMSLIB) |
| 375 ImageDecoder::qcmsOutputDeviceProfile(); // Initialize screen colorProfile. | 375 ImageDecoder::qcmsOutputDeviceProfile(); // Initialize screen colorProfile. |
| 376 #endif | 376 #endif |
| 377 | 377 |
| 378 // Read entire file content to data. | 378 // Read entire file content to data. |
| 379 | 379 |
| 380 RefPtr<SharedBuffer> data = readFile(argv[1]); | 380 RefPtr<SharedBuffer> data = readFile(argv[1]); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 400 exit(3); | 400 exit(3); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 // Results to stdout. | 404 // Results to stdout. |
| 405 | 405 |
| 406 double averageTime = totalTime / static_cast<double>(iterations); | 406 double averageTime = totalTime / static_cast<double>(iterations); |
| 407 printf("%f %f\n", totalTime, averageTime); | 407 printf("%f %f\n", totalTime, averageTime); |
| 408 return 0; | 408 return 0; |
| 409 } | 409 } |
| OLD | NEW |