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

Side by Side Diff: Source/web/ImageDecodeBench.cpp

Issue 1247033008: Update straggling ImageSource references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/platform/image-decoders/gif/GIFImageReader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 exit(2); 266 exit(2);
267 } 267 }
268 268
269 fclose(fp); 269 fclose(fp);
270 return SharedBuffer::create(buffer.get(), fileSize); 270 return SharedBuffer::create(buffer.get(), fileSize);
271 } 271 }
272 272
273 bool decodeImageData(SharedBuffer* data, bool colorCorrection) 273 bool decodeImageData(SharedBuffer* data, bool colorCorrection)
274 { 274 {
275 OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*data, 275 OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*data,
276 ImageSource::AlphaPremultiplied, colorCorrection ? 276 ImageDecoder::AlphaPremultiplied, colorCorrection ?
277 ImageSource::GammaAndColorProfileApplied : ImageSource::GammaAndColo rProfileIgnored); 277 ImageDecoder::GammaAndColorProfileApplied : ImageDecoder::GammaAndCo lorProfileIgnored);
278 278
279 bool allDataReceived = true; 279 bool allDataReceived = true;
280 decoder->setData(data, allDataReceived); 280 decoder->setData(data, allDataReceived);
281 281
282 int frameCount = decoder->frameCount(); 282 int frameCount = decoder->frameCount();
283 for (int i = 0; i < frameCount; ++i) { 283 for (int i = 0; i < frameCount; ++i) {
284 if (!decoder->frameBufferAtIndex(i)) 284 if (!decoder->frameBufferAtIndex(i))
285 return false; 285 return false;
286 } 286 }
287 287
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 exit(3); 374 exit(3);
375 } 375 }
376 } 376 }
377 377
378 // Results to stdout. 378 // Results to stdout.
379 379
380 double averageTime = totalTime / static_cast<double>(iterations); 380 double averageTime = totalTime / static_cast<double>(iterations);
381 printf("%f %f\n", totalTime, averageTime); 381 printf("%f %f\n", totalTime, averageTime);
382 return 0; 382 return 0;
383 } 383 }
OLDNEW
« no previous file with comments | « Source/platform/image-decoders/gif/GIFImageReader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698