From c289743864e2ab926a95e617a5cd1d29b26d1825 Mon Sep 17 00:00:00 2001 From: "mtklein@google.com" Date: Tue, 10 Sep 2013 19:23:38 +0000 Subject: Major bench refactoring. - Use FLAGS_. - Remove outer repeat loop. - Tune inner loop automatically. BUG=skia:1590 R=epoger@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/23478013 git-svn-id: http://skia.googlecode.com/svn/trunk@11187 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/AAClipBench.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'bench/AAClipBench.cpp') diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp index 276a8ff3e7..3c04bd47f7 100644 --- a/bench/AAClipBench.cpp +++ b/bench/AAClipBench.cpp @@ -23,10 +23,6 @@ class AAClipBench : public SkBenchmark { bool fDoPath; bool fDoAA; - enum { - N = SkBENCHLOOP(200), - }; - public: AAClipBench(void* param, bool doPath, bool doAA) : INHERITED(param) @@ -53,7 +49,7 @@ protected: SkPaint paint; this->setupPaint(&paint); - for (int i = 0; i < N; ++i) { + for (int i = 0; i < this->getLoops(); ++i) { // jostle the clip regions each time to prevent caching fClipRect.offset((i % 2) == 0 ? SkIntToScalar(10) : SkIntToScalar(-10), 0); fClipPath.reset(); @@ -96,7 +92,6 @@ class NestedAAClipBench : public SkBenchmark { SkRect fDrawRect; SkRandom fRandom; - static const int kNumDraws = SkBENCHLOOP(2); static const int kNestingDepth = 3; static const int kImageSize = 400; @@ -169,7 +164,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { - for (int i = 0; i < kNumDraws; ++i) { + for (int i = 0; i < this->getLoops(); ++i) { SkPoint offset = SkPoint::Make(0, 0); this->recurse(canvas, 0, offset); } @@ -188,10 +183,6 @@ class AAClipBuilderBench : public SkBenchmark { bool fDoPath; bool fDoAA; - enum { - N = SkBENCHLOOP(200), - }; - public: AAClipBuilderBench(void* param, bool doPath, bool doAA) : INHERITED(param) { fDoPath = doPath; @@ -212,7 +203,7 @@ protected: SkPaint paint; this->setupPaint(&paint); - for (int i = 0; i < N; ++i) { + for (int i = 0; i < this->getLoops(); ++i) { SkAAClip clip; if (fDoPath) { clip.setPath(fPath, &fRegion, fDoAA); @@ -244,16 +235,13 @@ public: protected: virtual const char* onGetName() { return "aaclip_setregion"; } virtual void onDraw(SkCanvas*) { - for (int i = 0; i < N; ++i) { + for (int i = 0; i < this->getLoops(); ++i) { SkAAClip clip; clip.setRegion(fRegion); } } private: - enum { - N = SkBENCHLOOP(400), - }; SkRegion fRegion; typedef SkBenchmark INHERITED; }; -- cgit v1.2.3