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

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

Issue 2203903002: Color: Read embedded ICC profiles regardless of QCMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add plumbing through to ImageFrame Created 4 years, 4 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 fclose(fp); 256 fclose(fp);
257 return SharedBuffer::create(buffer.get(), fileSize); 257 return SharedBuffer::create(buffer.get(), fileSize);
258 } 258 }
259 259
260 bool decodeImageData(SharedBuffer* data, bool colorCorrection, size_t packetSize ) 260 bool decodeImageData(SharedBuffer* data, bool colorCorrection, size_t packetSize )
261 { 261 {
262 std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(*data, 262 std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(*data,
263 ImageDecoder::AlphaPremultiplied, colorCorrection ? 263 ImageDecoder::AlphaPremultiplied, colorCorrection ?
264 ImageDecoder::GammaAndColorProfileApplied : ImageDecoder::GammaAndCo lorProfileIgnored); 264 ImageDecoder::GammaAndColorProfileApplied : ImageDecoder::GammaAndCo lorProfileNotApplied);
265 265
266 if (!packetSize) { 266 if (!packetSize) {
267 bool allDataReceived = true; 267 bool allDataReceived = true;
268 decoder->setData(data, allDataReceived); 268 decoder->setData(data, allDataReceived);
269 269
270 int frameCount = decoder->frameCount(); 270 int frameCount = decoder->frameCount();
271 for (int i = 0; i < frameCount; ++i) { 271 for (int i = 0; i < frameCount; ++i) {
272 if (!decoder->frameBufferAtIndex(i)) 272 if (!decoder->frameBufferAtIndex(i))
273 return false; 273 return false;
274 } 274 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698