Each benchmark that needs a bitmap will now make its own.

Before, the bitmaps were created and then passed to the benchmark. However, some benchmarks in the future will not require bitmaps. This will remove the necessity of passing around an extraneous bitmap to those tests.

Review URL: https://codereview.appspot.com/6356081

git-svn-id: http://skia.googlecode.com/svn/trunk@4519 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 78b9caa..eb5726a 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -21,13 +21,11 @@
 const int DEFAULT_TILE_HEIGHT = 256;
 
 struct Options;
-static void run_simple_benchmark(SkPicture* picture, const SkBitmap&,
-                                 const Options&);
+static void run_simple_benchmark(SkPicture* picture, const Options&);
 
 struct Options {
     int fRepeats;
-    void (*fBenchmark) (SkPicture*, const SkBitmap& bitmap,
-                        const Options& options);
+    void (*fBenchmark) (SkPicture*, const Options& options);
     int fTileWidth;
     int fTileHeight;
     double fTileWidthPercentage;
@@ -63,9 +61,10 @@
 "                                     Default is to not use tiling\n");
 }
 
-static void run_simple_benchmark(SkPicture* picture,
-                                 const SkBitmap& bitmap,
-                                 const Options& options) {
+static void run_simple_benchmark(SkPicture* picture, const Options& options) {
+    SkBitmap bitmap;
+    sk_tools::setup_bitmap(&bitmap, picture->width(), picture->height());
+
     SkCanvas canvas(bitmap);
 
     // We throw this away to remove first time effects (such as paging in this
@@ -121,8 +120,10 @@
 
 }
 
-static void run_tile_benchmark(SkPicture* picture, const SkBitmap& bitmap,
-                               const Options& options) {
+static void run_tile_benchmark(SkPicture* picture, const Options& options) {
+    SkBitmap bitmap;
+    sk_tools::setup_bitmap(&bitmap, picture->width(), picture->height());
+
     SkTArray<TileInfo> tiles;
     setup_tiles(picture, bitmap, options, &tiles);
 
@@ -158,8 +159,10 @@
     writer.endRecording();
 }
 
-static void run_pipe_benchmark(SkPicture* picture, const SkBitmap& bitmap,
-                                    const Options& options) {
+static void run_pipe_benchmark(SkPicture* picture, const Options& options) {
+    SkBitmap bitmap;
+    sk_tools::setup_bitmap(&bitmap, picture->width(), picture->height());
+
     SkCanvas canvas(bitmap);
 
     // We throw this away to remove first time effects (such as paging in this
@@ -187,8 +190,6 @@
     }
 
     SkPicture picture(&inputStream);
-    SkBitmap bitmap;
-    sk_tools::setup_bitmap(&bitmap, picture.width(), picture.height());
 
     SkString filename;
     sk_tools::get_basename(&filename, inputPath);
@@ -204,7 +205,7 @@
                                                  / 100);
     }
 
-    options->fBenchmark(&picture, bitmap, *options);
+    options->fBenchmark(&picture, *options);
 }
 
 static bool is_percentage(char* const string) {