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

Side by Side Diff: skia/ext/image_operations_bench.cc

Issue 20182002: Make inttypes.h and similar macro usage C++11-friendly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: line Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This small program is used to measure the performance of the various 5 // This small program is used to measure the performance of the various
6 // resize algorithms offered by the ImageOperations::Resize function. 6 // resize algorithms offered by the ImageOperations::Resize function.
7 // It will generate an empty source bitmap, and rescale it to specified 7 // It will generate an empty source bitmap, and rescale it to specified
8 // dimensions. It will repeat this operation multiple time to get more accurate 8 // dimensions. It will repeat this operation multiple time to get more accurate
9 // average throughput. Because it uses elapsed time to do its math, it is only 9 // average throughput. Because it uses elapsed time to do its math, it is only
10 // accurate on an idle system (but that approach was deemed more accurate 10 // accurate on an idle system (but that approach was deemed more accurate
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 dest = skia::ImageOperations::Resize(source, 242 dest = skia::ImageOperations::Resize(source,
243 method_, 243 method_,
244 dest_.width(), dest_.height()); 244 dest_.width(), dest_.height());
245 } 245 }
246 246
247 const int64 elapsed_us = (base::TimeTicks::Now() - start).InMicroseconds(); 247 const int64 elapsed_us = (base::TimeTicks::Now() - start).InMicroseconds();
248 248
249 const uint64 num_bytes = static_cast<uint64>(num_iterations_) * 249 const uint64 num_bytes = static_cast<uint64>(num_iterations_) *
250 (GetBitmapSize(&source) + GetBitmapSize(&dest)); 250 (GetBitmapSize(&source) + GetBitmapSize(&dest));
251 251
252 printf("%"PRIu64" MB/s,\telapsed = %"PRIu64" source=%d dest=%d\n", 252 printf("%" PRIu64 " MB/s,\telapsed = %" PRIu64 " source=%d dest=%d\n",
253 static_cast<uint64>(elapsed_us == 0 ? 0 : num_bytes / elapsed_us), 253 static_cast<uint64>(elapsed_us == 0 ? 0 : num_bytes / elapsed_us),
254 static_cast<uint64>(elapsed_us), 254 static_cast<uint64>(elapsed_us),
255 GetBitmapSize(&source), GetBitmapSize(&dest)); 255 GetBitmapSize(&source), GetBitmapSize(&dest));
256 256
257 return true; 257 return true;
258 } 258 }
259 259
260 // A small class to automatically call Reset on the global command line to 260 // A small class to automatically call Reset on the global command line to
261 // avoid nasty valgrind complaints for the leak of the global command line. 261 // avoid nasty valgrind complaints for the leak of the global command line.
262 class CommandLineAutoReset { 262 class CommandLineAutoReset {
(...skipping 21 matching lines...) Expand all
284 return 1; 284 return 1;
285 } 285 }
286 286
287 if (!bench.Run()) { 287 if (!bench.Run()) {
288 printf("Failed to run benchmark\n"); 288 printf("Failed to run benchmark\n");
289 return 1; 289 return 1;
290 } 290 }
291 291
292 return 0; 292 return 0;
293 } 293 }
OLDNEW
« no previous file with comments | « ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h ('k') | third_party/leveldatabase/chromium_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698