From: rileya@google.com Date: Tue, 28 Aug 2012 19:13:39 +0000 (+0000) Subject: Change picture record benchmark to include begin/end record in timings and make the... X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15004 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edfbff683e8f3ab55656c1818f153f605c4f433b;p=platform%2Fupstream%2FlibSkiaSharp.git Change picture record benchmark to include begin/end record in timings and make the source picture draw itself into record canvas, so it records the draws instead of directly copying the picture. Review URL: https://codereview.appspot.com/6501045 git-svn-id: http://skia.googlecode.com/svn/trunk@5323 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/tools/PictureBenchmark.cpp b/tools/PictureBenchmark.cpp index 164d3c3..d24bb8b 100644 --- a/tools/PictureBenchmark.cpp +++ b/tools/PictureBenchmark.cpp @@ -88,10 +88,11 @@ void RecordPictureBenchmark::run(SkPicture* pict) { for (int i = 0; i < fRepeats + 1; ++i) { SkPicture replayer; - SkCanvas* recorder = replayer.beginRecording(pict->width(), pict->height()); timer->start(); - recorder->drawPicture(*pict); + SkCanvas* recorder = replayer.beginRecording(pict->width(), pict->height()); + pict->draw(recorder); + replayer.endRecording(); timer->end(); // We want to ignore first time effects