Refactored the bitmap creation into PictureRenderer.
Further, the picture is also stored in the PictureRenderer.
The main gain of all of this is that we will not have to change how the device in more than one place when we end up adding different devices.
Review URL: https://codereview.appspot.com/6458074
git-svn-id: http://skia.googlecode.com/svn/trunk@4990 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 68f1c53..86de9ba 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -96,11 +96,15 @@
SkPicture picture(&inputStream);
SkBitmap bitmap;
sk_tools::setup_bitmap(&bitmap, picture.width(), picture.height());
- SkCanvas canvas(bitmap);
- renderer.init(picture);
- renderer.render(&picture, &canvas);
+ renderer.init(&picture);
+
+ renderer.render();
+
+ renderer.getCanvas()->readPixels(&bitmap, 0, 0);
write_output(outputDir, inputFilename, bitmap);
+
+ renderer.end();
}
static void process_input(const SkString& input, const SkString& outputDir,