Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp

Issue 2512683003: Create ImageDecoder target color space (Closed)
Patch Set: Fix mid-air collision with https://codereview.chromium.org/2483243003 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 base::CommandLine::Init(argc, argv); 305 base::CommandLine::Init(argc, argv);
306 306
307 // If the platform supports color correction, allow it to be controlled. 307 // If the platform supports color correction, allow it to be controlled.
308 308
309 bool applyColorCorrection = false; 309 bool applyColorCorrection = false;
310 310
311 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) { 311 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) {
312 applyColorCorrection = (--argc, ++argv, true); 312 applyColorCorrection = (--argc, ++argv, true);
313 WebVector<char> profile; 313 WebVector<char> profile;
314 getScreenColorProfile(&profile); // Returns a color spin color profile. 314 getScreenColorProfile(&profile); // Returns a color spin color profile.
315 ImageDecoder::setTargetColorProfile(profile); 315 ImageDecoder::setGlobalTargetColorProfile(profile);
316 } 316 }
317 317
318 if (argc < 2) { 318 if (argc < 2) {
319 fprintf(stderr, 319 fprintf(stderr,
320 "Usage: %s [--color-correct] file [iterations] [packetSize]\n", 320 "Usage: %s [--color-correct] file [iterations] [packetSize]\n",
321 argv[0]); 321 argv[0]);
322 exit(1); 322 exit(1);
323 } 323 }
324 324
325 // Control decode bench iterations and packet size. 325 // Control decode bench iterations and packet size.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 exit(3); 391 exit(3);
392 } 392 }
393 } 393 }
394 394
395 // Results to stdout. 395 // Results to stdout.
396 396
397 double averageTime = totalTime / static_cast<double>(iterations); 397 double averageTime = totalTime / static_cast<double>(iterations);
398 printf("%f %f\n", totalTime, averageTime); 398 printf("%f %f\n", totalTime, averageTime);
399 return 0; 399 return 0;
400 } 400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698