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

Unified Diff: skia/ext/image_operations_bench.cc

Issue 6334070: SIMD implementation of Convolver for Lanczos filter etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try to fix win Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« skia/ext/image_operations.cc ('K') | « skia/ext/image_operations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations_bench.cc
diff --git a/skia/ext/image_operations_bench.cc b/skia/ext/image_operations_bench.cc
index f590458ea745464ff948c5cfb848ec93e2605689..49d29d986080144caddc7f68d07269c0de2f0554 100644
--- a/skia/ext/image_operations_bench.cc
+++ b/skia/ext/image_operations_bench.cc
@@ -232,7 +232,16 @@ bool Benchmark::Run() const {
source.setConfig(SkBitmap::kARGB_8888_Config,
source_.width(), source_.height());
source.allocPixels();
- source.eraseARGB(0, 0, 0, 0);
+
+ // Randomize the image for testing.
+ srand(time(0));
+ unsigned char* src_ptr = static_cast<unsigned char*>(source.getPixels());
+ for (int y = 0; y < source_.height(); y++) {
+ for (int x = 0; x < source_.width()*4; x++) {
evannier 2011/02/14 23:45:13 I am not much of a fan of the hard coded '4', but
fbarchard 2011/02/15 23:16:45 The width()*4 should also have a space. Maybe you
jiesun 2011/02/17 20:17:58 Done.
jiesun 2011/02/17 20:17:58 Done.
+ src_ptr[x] = rand() % 255;
+ }
+ src_ptr += source.rowBytes();
+ }
SkBitmap dest;
« skia/ext/image_operations.cc ('K') | « skia/ext/image_operations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698