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

Unified Diff: bench/RegionBench.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 | « bench/RefCntBench.cpp ('k') | bench/RegionContainBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RegionBench.cpp
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index 7a306e97c33c392dc5ac7f62158c630b66ca7efe..ffd674a881341edeea9bc48bf51fa91bc2269d11 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -74,12 +74,10 @@ public:
SkRegion fA, fB;
Proc fProc;
SkString fName;
- int fLoopMul;
enum {
W = 1024,
H = 768,
- N = SkBENCHLOOP(2000)
};
SkIRect randrect(SkRandom& rand) {
@@ -90,10 +88,9 @@ public:
return SkIRect::MakeXYWH(x, y, w >> 1, h >> 1);
}
- RegionBench(void* param, int count, Proc proc, const char name[], int mul = 1) : INHERITED(param) {
+ RegionBench(void* param, int count, Proc proc, const char name[]) : INHERITED(param) {
fProc = proc;
fName.printf("region_%s_%d", name, count);
- fLoopMul = mul;
SkRandom rand;
for (int i = 0; i < count; i++) {
@@ -108,8 +105,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
Proc proc = fProc;
- int n = fLoopMul * N;
- for (int i = 0; i < n; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
proc(fA, fB);
}
}
@@ -125,9 +121,9 @@ static SkBenchmark* gF1(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sec
static SkBenchmark* gF2(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diff_proc, "difference")); }
static SkBenchmark* gF3(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diffrect_proc, "differencerect")); }
static SkBenchmark* gF4(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diffrectbig_proc, "differencerectbig")); }
-static SkBenchmark* gF5(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsrect_proc, "containsrect", 100)); }
-static SkBenchmark* gF6(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrgn_proc, "intersectsrgn", 10)); }
-static SkBenchmark* gF7(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrect_proc, "intersectsrect", 200)); }
+static SkBenchmark* gF5(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsrect_proc, "containsrect")); }
+static SkBenchmark* gF6(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrgn_proc, "intersectsrgn")); }
+static SkBenchmark* gF7(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrect_proc, "intersectsrect")); }
static SkBenchmark* gF8(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsxy_proc, "containsxy")); }
static BenchRegistry gR0(gF0);
« no previous file with comments | « bench/RefCntBench.cpp ('k') | bench/RegionContainBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698