Save/Restore around bench runs.
authormtklein <mtklein@chromium.org>
Thu, 2 Oct 2014 20:03:58 +0000 (13:03 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 2 Oct 2014 20:03:58 +0000 (13:03 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/619353002

bench/Benchmark.cpp

index 9205ba97c958dae3a26c8a6cc6223dcea09427c7..88e385d2d1840a841c9b0e6dc84c73107c4c7af7 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "Benchmark.h"
 
+#include "SkCanvas.h"
 #include "SkPaint.h"
 #include "SkParse.h"
 
@@ -37,6 +38,7 @@ void Benchmark::preDraw() {
 }
 
 void Benchmark::draw(const int loops, SkCanvas* canvas) {
+    SkAutoCanvasRestore ar(canvas, true/*save now*/);
     this->onDraw(loops, canvas);
 }