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; |