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

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

Issue 2426723005: Use SkColorSpaceXform to handle color conversions in decoders (Closed)
Patch Set: Remove ifdefs - fixes blink_platform_unittests Created 4 years, 2 months 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(QCMSLIB)
313 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) 312 if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0)
314 applyColorCorrection = (--argc, ++argv, true); 313 applyColorCorrection = (--argc, ++argv, true);
315 314
316 if (argc < 2) { 315 if (argc < 2) {
317 fprintf(stderr, 316 fprintf(stderr,
318 "Usage: %s [--color-correct] file [iterations] [packetSize]\n", 317 "Usage: %s [--color-correct] file [iterations] [packetSize]\n",
319 argv[0]); 318 argv[0]);
320 exit(1); 319 exit(1);
321 } 320 }
322 #else
323 if (argc < 2) {
324 fprintf(stderr, "Usage: %s file [iterations] [packetSize]\n", argv[0]);
325 exit(1);
326 }
327 #endif
328 321
329 // Control decode bench iterations and packet size. 322 // Control decode bench iterations and packet size.
330 323
331 size_t iterations = 1; 324 size_t iterations = 1;
332 if (argc >= 3) { 325 if (argc >= 3) {
333 char* end = 0; 326 char* end = 0;
334 iterations = strtol(argv[2], &end, 10); 327 iterations = strtol(argv[2], &end, 10);
335 if (*end != '\0' || !iterations) { 328 if (*end != '\0' || !iterations) {
336 fprintf(stderr, 329 fprintf(stderr,
337 "Second argument should be number of iterations. " 330 "Second argument should be number of iterations. "
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 exit(3); 392 exit(3);
400 } 393 }
401 } 394 }
402 395
403 // Results to stdout. 396 // Results to stdout.
404 397
405 double averageTime = totalTime / static_cast<double>(iterations); 398 double averageTime = totalTime / static_cast<double>(iterations);
406 printf("%f %f\n", totalTime, averageTime); 399 printf("%f %f\n", totalTime, averageTime);
407 return 0; 400 return 0;
408 } 401 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698