Fix the PictureRecord step of BenchPictures.
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 6 Nov 2012 16:54:40 +0000 (16:54 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 6 Nov 2012 16:54:40 +0000 (16:54 +0000)
Review URL: https://codereview.appspot.com/6820100

git-svn-id: http://skia.googlecode.com/svn/trunk@6311 2bbb7eff-a529-9590-31e7-b0007b416f81

tools/PictureRenderer.cpp
tools/PictureRenderer.h

index d407b0e..23223da 100644 (file)
@@ -164,6 +164,11 @@ static bool writeAppendNumber(SkCanvas* canvas, const SkString* path, int number
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
+SkCanvas* RecordPictureRenderer::setupCanvas(int width, int height) {
+    // defer the canvas setup until the render step
+    return NULL;
+}
+
 bool RecordPictureRenderer::render(const SkString*) {
     SkAutoTUnref<SkPicture> replayer(this->createPicture());
     SkCanvas* recorder = replayer->beginRecording(fPicture->width(), fPicture->height(),
index a3c879a..3858f81 100644 (file)
@@ -169,6 +169,9 @@ class RecordPictureRenderer : public PictureRenderer {
 
     virtual SkString getNormalTimeFormat() SK_OVERRIDE { return SkString("%6.4f"); }
 
+protected:
+    virtual SkCanvas* setupCanvas(int width, int height) SK_OVERRIDE;
+
 private:
     virtual SkString getConfigNameInternal() SK_OVERRIDE;
 };