From 9d5dcda7818abfb1443400b391d3b35f18ffd96a Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Fri, 23 Jun 2017 16:44:34 -0400 Subject: We should draw at least once for benchmark Bug: skia:6792 Change-Id: Ia69c7601abead8f30963de709f22e27e04798319 Reviewed-on: https://skia-review.googlesource.com/20697 Reviewed-by: Mike Reed Commit-Queue: Yuqian Li --- bench/PathBench.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bench/PathBench.cpp') diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp index 6991db558d..757ffcc198 100644 --- a/bench/PathBench.cpp +++ b/bench/PathBench.cpp @@ -68,7 +68,7 @@ protected: } count >>= (3 * complexity()); - for (int i = 0; i < count; i++) { + for (int i = 0; i < SkTMax(1, count); i++) { canvas->drawPath(path, paint); } } @@ -1082,7 +1082,7 @@ class TightBoundsBench : public Benchmark { public: TightBoundsBench(SkRect (*proc)(const SkPath&), const char suffix[]) : fProc(proc) { fName.printf("tight_bounds_%s", suffix); - + const int N = 100; SkRandom rand; for (int i = 0; i < N; ++i) { @@ -1102,13 +1102,13 @@ protected: } const char* onGetName() override { return fName.c_str(); } - + void onDraw(int loops, SkCanvas* canvas) override { for (int i = 0; i < loops*100; ++i) { fProc(fPath); } } - + private: typedef Benchmark INHERITED; }; -- cgit v1.2.3