aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/AAClipBench.cpp
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-10 19:23:38 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-10 19:23:38 +0000
commitc289743864e2ab926a95e617a5cd1d29b26d1825 (patch)
tree2c559da19185181efd8bd92791fb758af5969800 /bench/AAClipBench.cpp
parent55ebe8eca0063ab1f3979d629749bc41ec409ac1 (diff)
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
Diffstat (limited to 'bench/AAClipBench.cpp')
-rw-r--r--bench/AAClipBench.cpp20
1 files changed, 4 insertions, 16 deletions
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;
};