Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3693)

Unified Diff: bench/AAClipBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bench/BicubicBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/AAClipBench.cpp
diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp
index 276a8ff3e724706a4c1ffa351d9017a8443b14cf..3c04bd47f77e7fbf6611172e9709b96b1a12b9d1 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;
};
« no previous file with comments | « no previous file | bench/BicubicBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698