aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-06 13:38:53 +0000
committerGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-06 13:38:53 +0000
commit61348d1cc68e7fa40d08c2c4bc03218305033838 (patch)
tree091f51035275b4f6cd96a2c6e364f04bed59c178 /bench
parent6c778164a743f8760dca251524d51848548b436f (diff)
Fix rtree bench name bug. Unreviewed.
git-svn-id: http://skia.googlecode.com/svn/trunk@5411 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r--bench/RTreeBench.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 759037e00e..2ee6deae7b 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -28,18 +28,17 @@ public:
: INHERITED(param)
, fTree(tree)
, fProc(proc)
- , fName(name)
- , fBulkLoad(bulkLoad) { }
-protected:
- virtual const char* onGetName() {
- SkString str;
- str.append("rtree_");
- str.append(fName);
- str.append("_build");
+ , fBulkLoad(bulkLoad) {
+ fName.append("rtree_");
+ fName.append(name);
+ fName.append("_build");
if (fBulkLoad) {
- str.append("_bulk");
+ fName.append("_bulk");
}
- return str.c_str();
+ }
+protected:
+ virtual const char* onGetName() {
+ return fName.c_str();
}
virtual void onDraw(SkCanvas* canvas) {
SkRandom rand;
@@ -55,7 +54,7 @@ protected:
private:
SkBBoxHierarchy* fTree;
MakeRectProc fProc;
- const char* fName;
+ SkString fName;
bool fBulkLoad;
typedef SkBenchmark INHERITED;
};
@@ -75,9 +74,14 @@ public:
: INHERITED(param)
, fTree(tree)
, fProc(proc)
- , fName(name)
, fBulkLoad(bulkLoad)
, fQuery(q) {
+ fName.append("rtree_");
+ fName.append(name);
+ fName.append("_query");
+ if (fBulkLoad) {
+ fName.append("_bulk");
+ }
SkRandom rand;
for (int j = 0; j < SkBENCHLOOP(NUM_QUERY_RECTS); ++j) {
fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j,
@@ -87,14 +91,7 @@ public:
}
protected:
virtual const char* onGetName() {
- SkString str;
- str.append("rtree_");
- str.append(fName);
- str.append("_query");
- if (fBulkLoad) {
- str.append("_bulk");
- }
- return str.c_str();
+ return fName.c_str();
}
virtual void onDraw(SkCanvas* canvas) {
SkRandom rand;
@@ -134,7 +131,7 @@ protected:
private:
SkBBoxHierarchy* fTree;
MakeRectProc fProc;
- const char* fName;
+ SkString fName;
bool fBulkLoad;
QueryType fQuery;
typedef SkBenchmark INHERITED;